Difference between revisions of "User talk:Haehn"

From NAMIC Wiki
Jump to: navigation, search
Line 14: Line 14:
 
volumeNode.SetModifiedSinceRead(1);
 
volumeNode.SetModifiedSinceRead(1);
 
slicer.VolumesGUI.GetLogic().SaveArchetypeVolume('/home/haehn/data/test.nrrd',volumeNode);"
 
slicer.VolumesGUI.GetLogic().SaveArchetypeVolume('/home/haehn/data/test.nrrd',volumeNode);"
 +
 +
* remote Frangi:
 +
<pre>
 +
${SIGMA_MIN}=$const(1.0)
 +
${SIGMA_MAX}=$const(4.0)
 +
${SIGMA_STEPS}=$const(10)
 +
${ALPHA}=$range(0.1,0.5,0.1)
 +
${BETA}=$range(500.0,1500.0,500.0)
 +
${GAMMA}=$range(300.0,1500.0,100.0)
 +
${FILE}=$const(00)
 +
${TYPE}=$const{RCA}
 +
${OUTPUT}=$const(/Volumes/DATA2/gwe-results/${FILE}-${TYPE}-out-${SIGMA_MIN}-${SIGMA_MAX}-N${SIGMA_STEPS}-${ALPHA}-${ALPHA2}.nrrd)
 +
 +
${SLICER_HOME}/Slicer3 --no_splash --evalpython
 +
"import sys;
 +
from Slicer import slicer;
 +
sys.path.append(str(slicer.Application.GetExtensionsInstallPath())+'/'+str(slicer.Application.GetSvnRevision())+'/VMTKVesselEnhancement/VMTKVesselEnhancement');
 +
from SlicerVMTKVesselEnhancementGUI import *;
 +
hiddengui = VMTKVesselEnhancement();
 +
from SlicerVMTKVesselEnhancementLogic import *;
 +
vesselness=SlicerVMTKVesselEnhancementLogic(hiddengui);
 +
 +
volNode=slicer.VolumesGUI.GetLogic().AddArchetypeVolume('/Volumes/DATA2/dhaehn/cutted/Image${FILE}_${TYPE}.nrrd','Vessels',0);
 +
matrix = slicer.vtkMatrix4x4();
 +
volNode.GetIJKToRASMatrix(matrix);
 +
 +
outVolumeData = vesselness.ApplyFrangiVesselness(volNode.GetImageData(),${SIGMA_MIN},${SIGMA_MAX},${SIGMA_STEPS},${ALPHA},${BETA},${GAMMA});
 +
 +
outputNode=slicer.MRMLScene.CreateNodeByClass('vtkMRMLScalarVolumeNode');
 +
volumeNode=slicer.MRMLScene.AddNode(outputNode);
 +
volumeNode.SetAndObserveImageData(outVolumeData);
 +
volumeNode.SetIJKToRASMatrix(matrix);
 +
volumeNode.SetModifiedSinceRead(1);
 +
slicer.VolumesGUI.GetLogic().SaveArchetypeVolume(${OUTPUT},volumeNode);
 +
Slicer.tk.eval('exit 0');"
 +
</pre>

Revision as of 10:48, 19 January 2010

Home < User talk:Haehn

my notes..

  • this code works locally:

"import sys; from Slicer import slicer; volNode=slicer.VolumesGUI.GetLogic().AddArchetypeVolume('/home/haehn/data/Image00_LCA.nrrd','Liver',0); matrix = slicer.vtkMatrix4x4(); volNode.GetIJKToRASMatrix(matrix);

outputNode=slicer.MRMLScene.CreateNodeByClass('vtkMRMLScalarVolumeNode'); volumeNode=slicer.MRMLScene.AddNode(outputNode); volumeNode.SetAndObserveImageData(volNode.GetImageData()); volumeNode.SetIJKToRASMatrix(matrix); volumeNode.SetModifiedSinceRead(1); slicer.VolumesGUI.GetLogic().SaveArchetypeVolume('/home/haehn/data/test.nrrd',volumeNode);"

  • remote Frangi:
${SIGMA_MIN}=$const(1.0)
${SIGMA_MAX}=$const(4.0)
${SIGMA_STEPS}=$const(10)
${ALPHA}=$range(0.1,0.5,0.1)
${BETA}=$range(500.0,1500.0,500.0)
${GAMMA}=$range(300.0,1500.0,100.0)
${FILE}=$const(00)
${TYPE}=$const{RCA}
${OUTPUT}=$const(/Volumes/DATA2/gwe-results/${FILE}-${TYPE}-out-${SIGMA_MIN}-${SIGMA_MAX}-N${SIGMA_STEPS}-${ALPHA}-${ALPHA2}.nrrd)

${SLICER_HOME}/Slicer3 --no_splash --evalpython 
"import sys;
from Slicer import slicer;
sys.path.append(str(slicer.Application.GetExtensionsInstallPath())+'/'+str(slicer.Application.GetSvnRevision())+'/VMTKVesselEnhancement/VMTKVesselEnhancement');
from SlicerVMTKVesselEnhancementGUI import *;
hiddengui = VMTKVesselEnhancement();
from SlicerVMTKVesselEnhancementLogic import *;
vesselness=SlicerVMTKVesselEnhancementLogic(hiddengui);

volNode=slicer.VolumesGUI.GetLogic().AddArchetypeVolume('/Volumes/DATA2/dhaehn/cutted/Image${FILE}_${TYPE}.nrrd','Vessels',0); 
matrix = slicer.vtkMatrix4x4();
volNode.GetIJKToRASMatrix(matrix);

outVolumeData = vesselness.ApplyFrangiVesselness(volNode.GetImageData(),${SIGMA_MIN},${SIGMA_MAX},${SIGMA_STEPS},${ALPHA},${BETA},${GAMMA});

outputNode=slicer.MRMLScene.CreateNodeByClass('vtkMRMLScalarVolumeNode');
volumeNode=slicer.MRMLScene.AddNode(outputNode);
volumeNode.SetAndObserveImageData(outVolumeData);
volumeNode.SetIJKToRASMatrix(matrix);
volumeNode.SetModifiedSinceRead(1);
slicer.VolumesGUI.GetLogic().SaveArchetypeVolume(${OUTPUT},volumeNode);
Slicer.tk.eval('exit 0');"