Skip to content

Commit

Permalink
Delete prints
Browse files Browse the repository at this point in the history
  • Loading branch information
DanicaSTFC committed Jan 30, 2024
1 parent 97b9767 commit 19e6b4c
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions src/idvc/dvc_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,6 @@ def startRegistration(self):
# the size to the largest size possible:
if max_size_of_box < registration_box_size:
rp['registration_box_size_entry'].setValue(max_size_of_box)
# print ("Start Registration Checked")
self.registration_parameters['start_registration_button'].setText("Confirm Registration")
rp['cancel_reg_button'].setVisible(True)
rp['registration_box_size_entry'].setEnabled(False)
Expand All @@ -1591,7 +1590,6 @@ def confirmRegistration(self):
"""
rp = self.registration_parameters
v = self.vis_widget_reg.frame.viewer
# print ("Start Registration Unchecked")
self.registration_parameters['start_registration_button'].setText("Restart registration")
rp['registration_box_size_entry'].setEnabled(True)
rp['select_point_zero'].setCheckable(True)
Expand All @@ -1608,7 +1606,6 @@ def confirmRegistration(self):
self.createPoint0(self.getPoint0WorldCoords())

def UpdateViewerSettingsPanelForRegistration(self):
# print("UpdateViewerSettings")
vs_widgets = self.visualisation_setting_widgets
rp = self.registration_parameters
if rp['start_registration_button'].isChecked():
Expand Down Expand Up @@ -1945,7 +1942,7 @@ def reg_viewer_update(self, type = None):
rp['translate_Y_entry'].setText(str(self.translate.GetTranslation()[1]*-1))
rp['translate_Z_entry'].setText(str(self.translate.GetTranslation()[2]*-1))
printme = str(self.registration_parameters['translate_X_entry'].text())
print("after reg"+printme)
#print("after reg"+printme)
#update the viewer:
v = self.vis_widget_reg.frame.viewer
if hasattr(v, 'img3D'):
Expand All @@ -1970,7 +1967,6 @@ def reg_viewer_update(self, type = None):

def OnKeyPressEventForRegistration(self, interactor, event):
key_code = interactor.GetKeyCode()
# print('OnKeyPressEventForRegistration', key_code)

rp = self.registration_parameters
if key_code in ['j','n','b','m'] and \
Expand All @@ -1981,7 +1977,6 @@ def OnKeyPressEventForRegistration(self, interactor, event):
def AfterKeyPressEventForRegistration(self, interactor, event):
#Have to re-adjust registration VOI after the orientation has been switched by the viewer.
key_code = interactor.GetKeyCode()
# print('AfterKeyPressEventForRegistration', key_code) #,event)
rp = self.registration_parameters

if key_code in ['x','y','z'] and rp['start_registration_button'].isChecked():
Expand All @@ -1993,7 +1988,6 @@ def translate_image_reg(self, *args, **kwargs):
key_code, event = args
rp = self.registration_parameters
v = self.vis_widget_reg.frame.viewer
# print("Current slice", current_slice)
trans = list(self.translate.GetTranslation())
orientation = v.style.GetSliceOrientation()
ij = [0,1]
Expand All @@ -2018,7 +2012,6 @@ def translate_image_reg(self, *args, **kwargs):
self.translate.SetTranslation(*trans)
self.translate.Update()
self.subtract.Update()
#print ("Translation", trans)

def automatic_reg_run(self, **kwargs):
"""Prepares the arguments for the class `automaticRegistration`. Gets the images in full resolution and cropps them.
Expand All @@ -2032,8 +2025,6 @@ def automatic_reg_run(self, **kwargs):
# get images
data = [self.unsampled_ref_image_data,self.unsampled_corr_image_data]
[image0,image1]=[Converter.vtk2numpy(el) for el in data]
print("imag0shape"+str(image0.shape))
print("imag1shape"+str(image1.shape))
image0, image1 = self.crop_images(image0, image1)


Expand All @@ -2059,19 +2050,14 @@ def crop_images(self, im0, im1):
reg_box_size = self.getRegistrationBoxSizeInWorldCoords()
target_x_extent = self.enlarge_extent(0)
target_y_extent = self.enlarge_extent(1)
print(target_x_extent,target_y_extent,self.enlarge_extent(2))
[im0,im1] = [el[:,target_y_extent[0]:target_y_extent[1]+1,target_x_extent[0]:target_x_extent[1]+1] for el in [im0, im1]]
print("imag0shape2"+str(im0.shape))
print("imag1shape2"+str(im1.shape))
if im0.shape[0] == self.unsampled_image_dimensions[2]:
im0 = im0[point0_z-reg_box_size:point0_z+reg_box_size+1,:,:]
else:
if im0.shape[0] == 2*reg_box_size + 1:
pass
else:
print("The automatic registration cannot be performed.")
print("imag0shape3"+str(im0.shape))
print("imag1shape3"+str(im1.shape))
return im0, im1

def find_p0_and_size(self):
Expand All @@ -2080,10 +2066,7 @@ def find_p0_and_size(self):
If the registration box is not fully included in the volumetric data, it accounts of the borders in both the negative
and positive directions."""
point0 = self.getPoint0WorldCoords()
print("point0worldcoord"+str(point0))
print("unsampled_image_dimensions"+str(self.unsampled_image_dimensions))
reg_box_size = self.getRegistrationBoxSizeInWorldCoords()
print("reg_box_size"+str(reg_box_size))
p3d_0 = np.array([reg_box_size, reg_box_size, reg_box_size])
size = np.array([[reg_box_size//2,3*reg_box_size//2],[reg_box_size//2,3*reg_box_size//2],[reg_box_size//2,3*reg_box_size//2]])
for dim in range(0,3):
Expand Down Expand Up @@ -2317,9 +2300,6 @@ def extendMask(self, **kwargs):

# create a blank image
dims = image_data.GetDimensions()
# print("Dims:" + str(dims))

#print(image_data.GetSpacing())

# progress_callback.emit(40)

Expand Down Expand Up @@ -3442,7 +3422,6 @@ def loadPointCloud(self, *args, **kwargs):
#self.clearPointCloud() #need to clear current pointcloud before we load next one TODO: move outside thread
progress_callback.emit(30)
self.roi = pointcloud_file
#print(self.roi)

points = np.loadtxt(self.roi)
# except ValueError as ve:
Expand Down

0 comments on commit 19e6b4c

Please sign in to comment.