2 Achegas c7c7dd498e ... ceead1ee41

Autor SHA1 Mensaxe Data
  Luka ceead1ee41 Code cleanup, minor fixes and translation. hai 11 meses
  Luka cc726e5eb4 Code cleanup, translation and minor fixes. hai 11 meses
Modificáronse 1 ficheiros con 15 adicións e 13 borrados
  1. 15 13
      SeekTransformModule/SeekTransformModule.py

+ 15 - 13
SeekTransformModule/SeekTransformModule.py

@@ -488,14 +488,14 @@ class MyTransformModuleLogic(ScriptedLoadableModuleLogic):
                     
                     dicomUIDs = volumeNode.GetAttribute("DICOM.instanceUIDs")
                     if not dicomUIDs:
-                        print("❌ To je NRRD volume!")
+                        print("❌ This is an NRRD volume!")
                         continue  # Preskoči, če ni DICOM volume
                     
                     if volumeNode and volumeNode.IsA("vtkMRMLScalarVolumeNode"):
-                        print(f"✔️ Najden volume: {volumeNode.GetName()} (ID: {volumeItem})")
+                        print(f"✔️ Found volume: {volumeNode.GetName()} (ID: {volumeItem})")
                 
                     if not volumeNode or not volumeNode.IsA("vtkMRMLScalarVolumeNode"):
-                        print("ne najdem volumeNode")
+                        print("Can't find volumeNode")
                         continue  # Preskoči, če ni veljaven volume
 
                     # Preveri, če volume ima StorageNode (drugače `.GetFileName()` vrže napako)
@@ -503,7 +503,7 @@ class MyTransformModuleLogic(ScriptedLoadableModuleLogic):
                     
                     
                     if not storageNode:
-                        print("ne najdem storageNode")
+                        print("Can't find storageNode")
                         continue  # Preskoči, če volume nima shranjenih DICOM podatkov
                     volumeName = volumeNode.GetName()
                     #print(volumeName)
@@ -523,7 +523,7 @@ class MyTransformModuleLogic(ScriptedLoadableModuleLogic):
                     #print(f"Volume {volumeNode.GetName()} - Dimenzije: {dimensions}, Spacing: {spacing}")
 
                     if modality != "CT":
-                        print("Ni CT slika")
+                        print("Not a CT")
                         continue  # Preskoči, če ni CT
 
                     
@@ -561,14 +561,14 @@ class MyTransformModuleLogic(ScriptedLoadableModuleLogic):
                 ct_points = [centroid for centroid, _ in volume_points_dict[("CT", ct_volume_name)]]
 
                 if len(ct_points) < 3:
-                    print(f"CT volumen {ct_volume_name} nima dovolj točk za registracijo.")
+                    print(f"CT volume {ct_volume_name} doesn't have enough points for registration.")
                 else:
                     for cbct_volume_name in cbct_list:
                         cbct_points = [centroid for centroid, _ in volume_points_dict[("CBCT", cbct_volume_name)]]
 
                         print(f"\nProcessing CBCT Volume: {cbct_volume_name}")
                         if len(cbct_points) < 3:
-                            print(f"CBCT Volume '{cbct_volume_name}' nima dovolj točk za registracijo.")
+                            print(f"CBCT Volume '{cbct_volume_name}' doesn't have enough points for registration.")
                             continue
 
                         # Shranjevanje razdalj
@@ -619,7 +619,7 @@ class MyTransformModuleLogic(ScriptedLoadableModuleLogic):
 
                         if applyScaling:
                             scaling_factors = compute_optimal_scaling_per_axis(cbct_points, ct_points)
-                            print("Skalirni faktorji: ", scaling_factors)
+                            print("Scaling factors: ", scaling_factors)
                             cbct_points = compute_scaling(cbct_points, scaling_factors)
 
                         if applyRotation:
@@ -648,17 +648,19 @@ class MyTransformModuleLogic(ScriptedLoadableModuleLogic):
                         cbct_volume_node.SetAndObserveTransformNodeID(transform_node.GetID())
 
                         # Uporabi transformacijo na volumnu (fizična aplikacija)
-                        slicer.vtkSlicerTransformLogic().hardenTransform(cbct_volume_node)
-                        print("Transform uspešen na", cbct_volume_name)
+                        slicer.vtkSlicerTransformLogic().hardenTransform(cbct_volume_node) #aplicira transformacijo na volumnu
+                        slicer.mrmlScene.RemoveNode(transform_node) # Odstrani transformacijo iz scene
+                        print("Transform successful on ", cbct_volume_name)
 
             else:
-                print(f"Study {studyItem} nima ustreznih CBCT in CT volumnov.")
+                print(f"Study {studyItem} doesn't have any appropriate CT or CBCT volumes.")
 
         # Izpis globalne statistike
-        print("Razdalje med CT in CBCTji: ", ctcbct_distance)
-        print("Razdalje med markerji: ", prostate_size_est)
+        
         
         if(writefilecheck):
+            print("Distances between CT & CBCT markers: ", ctcbct_distance)
+            print("Distances between pairs of markers for each volume: ", prostate_size_est)
             # Define the file path for the CSV file
             file_path = os.path.join(os.path.dirname(__file__), "study_data.csv")