diff --git a/VisSimCommon/VisSimCommon.py b/VisSimCommon/VisSimCommon.py index fbe7537..e2f6d08 100755 --- a/VisSimCommon/VisSimCommon.py +++ b/VisSimCommon/VisSimCommon.py @@ -263,13 +263,12 @@ def t2v(self,txt): # This function convert an IJK point to RAS point # input: a point vector and volume node # output: a point vector - def ptIJK2RAS(self,ptIJK,inputImg): # imgPath or imgNode are supported + def ptIJK2RAS(self,ptIJK, inputImg): # imgPath or imgNode are supported #TODO: add option for printing # create a IJK2RAs transformation matrix inputImgNode =inputImg if (isinstance(inputImg, str)): - inputImgNode = slicer.util.loadVolume( inputImg, returnNode=True) - + inputImgNode = slicer.util.loadVolume( inputImg) ijk2rasM = vtk.vtkMatrix4x4() inputImgNode.GetIJKToRASMatrix(ijk2rasM) ptRAS=np.zeros((len(ptIJK),3)) @@ -469,13 +468,13 @@ def runCropping(self, inputVolume, pointT,croppingLengthT, samplingLengthT, hrCh #TODO: Get Slicer PATH SlicerPath = os.path.abspath(os.path.join(os.path.abspath(os.path.join(os.sys.executable, os.pardir)), os.pardir)) SlicerBinPath = os.path.join(SlicerPath,"Slicer") - ResampleBinPath = os.path.join(SlicerPath,"lib","Slicer-4.11" , "cli-modules","ResampleScalarVolume" ) + ResampleBinPath = os.path.join(SlicerPath,"lib","Slicer-5.4" , "cli-modules","ResampleScalarVolume" ) if sys.platform == 'win32': ResampleBinPath + ".exe" resamplingCommand = SlicerBinPath + " --launch " + ResampleBinPath else: #note: in windows, no need to use --launch - resamplingCommand = ResampleBinPath + ".exe" + resamplingCommand = ResampleBinPath print(resamplingCommand) si = None @@ -969,7 +968,9 @@ def getItemInfo(self, segNode, masterNode, tblNode, vtID): if (vtID ==7) and (self.vtVars['vtMethodID']== "0"): # for testing print("updating COM in table ..............") segID = segNode.GetSegmentation().GetSegmentIdBySegmentName("C"+str(vtID)) - modelNode = segNode.GetClosedSurfaceRepresentation(segID) + #modelNode = segNode.GetClosedSurfaceRepresentation(segID) + modelNode = segNode.GetClosedSurfaceInternalRepresentation(segID) + com = vtk.vtkCenterOfMass(); com.SetInputData(modelNode); com.Update() segNodeCoM = com.GetCenter() tblNode.SetCellText(idx,2,str(segNodeCoM[0])) diff --git a/link2MeWin.BAT b/link2MeWin.BAT deleted file mode 100644 index 8112c78..0000000 --- a/link2MeWin.BAT +++ /dev/null @@ -1,17 +0,0 @@ -REM Create links to github sources: -Rem /home/%USERNAME%/.config/NA-MIC/Extensions-28296 -REM open cmd as admin then run: mklink dest src -set ext="SlicerCochlea" -set vr="\lib\Slicer-4.11" -set p1="C:\Users\%USERNAME%\AppData\Roaming\NA-MIC\Extensions-28296\" -set p2="\qt-scripted-modules\" -set src="D:\myGitHub\"%ext%"\master\" - -rename %p1%%ext%%vr%%p2%"CochleaSeg.py" "CochleaSeg.py.bk" -mklink %p1%%ext%%vr%%p2%"CochleaSeg.py" %src%"CochleaSeg""\CochleaSeg.py" - -rename %p1%%ext%%vr%%p2%"CochleaReg.py" "CochleaReg.py.bk" -mklink %p1%%ext%%vr%%p2%"CochleaReg.py" %src%"CochleaReg""\CochleaReg.py" - -rename %p1%%ext%%vr%%p2%"VisSimCommon.py" "VisSimCommon.py.bk" -mklink %p1%%ext%%vr%%p2%"VisSimCommon.py" %src%"VisSimCommon""\VisSimCommon.py" \ No newline at end of file