@@ -263,13 +263,12 @@ def t2v(self,txt):
263263# This function convert an IJK point to RAS point
264264# input: a point vector and volume node
265265# output: a point vector
266- def ptIJK2RAS (self ,ptIJK ,inputImg ): # imgPath or imgNode are supported
266+ def ptIJK2RAS (self ,ptIJK , inputImg ): # imgPath or imgNode are supported
267267 #TODO: add option for printing
268268 # create a IJK2RAs transformation matrix
269269 inputImgNode = inputImg
270270 if (isinstance (inputImg , str )):
271- inputImgNode = slicer .util .loadVolume ( inputImg , returnNode = True )
272-
271+ inputImgNode = slicer .util .loadVolume ( inputImg )
273272 ijk2rasM = vtk .vtkMatrix4x4 ()
274273 inputImgNode .GetIJKToRASMatrix (ijk2rasM )
275274 ptRAS = np .zeros ((len (ptIJK ),3 ))
@@ -469,13 +468,13 @@ def runCropping(self, inputVolume, pointT,croppingLengthT, samplingLengthT, hrCh
469468 #TODO: Get Slicer PATH
470469 SlicerPath = os .path .abspath (os .path .join (os .path .abspath (os .path .join (os .sys .executable , os .pardir )), os .pardir ))
471470 SlicerBinPath = os .path .join (SlicerPath ,"Slicer" )
472- ResampleBinPath = os .path .join (SlicerPath ,"lib" ,"Slicer-4.11 " , "cli-modules" ,"ResampleScalarVolume" )
471+ ResampleBinPath = os .path .join (SlicerPath ,"lib" ,"Slicer-5.4 " , "cli-modules" ,"ResampleScalarVolume" )
473472 if sys .platform == 'win32' :
474473 ResampleBinPath + ".exe"
475474 resamplingCommand = SlicerBinPath + " --launch " + ResampleBinPath
476475 else :
477476 #note: in windows, no need to use --launch
478- resamplingCommand = ResampleBinPath + ".exe"
477+ resamplingCommand = ResampleBinPath
479478
480479 print (resamplingCommand )
481480 si = None
@@ -969,7 +968,9 @@ def getItemInfo(self, segNode, masterNode, tblNode, vtID):
969968 if (vtID == 7 ) and (self .vtVars ['vtMethodID' ]== "0" ): # for testing
970969 print ("updating COM in table .............." )
971970 segID = segNode .GetSegmentation ().GetSegmentIdBySegmentName ("C" + str (vtID ))
972- modelNode = segNode .GetClosedSurfaceRepresentation (segID )
971+ #modelNode = segNode.GetClosedSurfaceRepresentation(segID)
972+ modelNode = segNode .GetClosedSurfaceInternalRepresentation (segID )
973+
973974 com = vtk .vtkCenterOfMass (); com .SetInputData (modelNode ); com .Update ()
974975 segNodeCoM = com .GetCenter ()
975976 tblNode .SetCellText (idx ,2 ,str (segNodeCoM [0 ]))
0 commit comments