open-discussion > Using SPHARM-PDM on Slicer3 with vtk files
Showing 1-10 of 10 posts
Display:
Results per page:
Jul 6, 2011  01:07 PM | Swati Chandhoke
Using SPHARM-PDM on Slicer3 with vtk files
Hello,

I have been trying to use the interactive Shape Analysis Module (v1.10) on Slicer3 (Version 3.6.3) to perform a Group Shape Analysis. Using the AutomaticSPHARM Shape Analysis Tutorial, I followed the instructions as given and created a csv input file. This csv file listed the patients and controls and the file paths. However, these files were in .vtk format (the individuals were segmented using FIRST FSL version 4.14). When trying to process them using the interactive Shape Analysis Module in slicer, the following error came up: 

ERROR: In /extra/pieper/slicer3/release/Slicer3/Modules/CommandLineModule/vtkCommandLineModuleLogic.cxx, line 1577
vtkCommandLineModuleLogic (0x76042c0): Shape Analysis Module terminated with a fault.

I was wondering if there was a way to load vtk files into the shape analysis module for processing? If this isn't possible, I wanted to know what kinds of files would be acceptable for input in the shape analysis module (on the tutorial, they mention gipl.gz)? If the gipl.gz or other file type is necessary, what is the best way to convert from vtk to gipl.gz (or other file type) for use in the interactive Shape Analysis Module (not the command line format)?

Your help would be greatly appreciated!
Jul 7, 2011  04:07 AM | Beatriz Paniagua
RE: Using SPHARM-PDM on Slicer3 with vtk files
Hi Swati, 


Yes, atm the only possible formats as inputs are binary segmentations that are ITK cpmpatible (gipl.gz). To convert vtk files to gipl files we use a in-house tool that we are not distributing in NITRC right now. If you are interested I can try to see if it is possible to upload this tool. 

Regards,
BEATRIZ
Jul 8, 2011  08:07 AM | Swati Chandhoke
RE: Using SPHARM-PDM on Slicer3 with vtk files
Hi Beatriz,

Thanks so much for your quick response. I am definitely interested in trying to convert the vtk files to gipl if that is what the Shape Analysis tool requires. If you could give me some further help - either with your tool or another you may know of - that would be great! Thanks for your help!

Best,
Swati
Jul 11, 2011  05:07 AM | Beatriz Paniagua
RE: Using SPHARM-PDM on Slicer3 with vtk files
Hi Swati,


In last distribution of ShapeAnalysisModule (v 1.10.10) Particle Correspondence Preprocessing has been added as an external module. You only have to write a parameterfile (file.params) and use it as input.

NUMBER_OF_SHAPES=N
NUMBER_OF_ATTRIBUTES=0
TEMPLATE_INDEX=1
WEIGHTS= 1 1 1 1 1
mesh1.vtk
mesh2.vtk
...
meshN.vtk

Then in the module you just have to select write binary volumes checkbox. 
I hope that helps.


Regards,
BEATRIZ
Jul 14, 2011  12:07 PM | Swati Chandhoke
RE: Using SPHARM-PDM on Slicer3 with vtk files
Hi Beatriz,

I followed your instructions using the Particle Correspondence Preprocessing and used a .params file as you instructed to convert some of the vtk files. This process created distance maps and binaries without error HOWEVER, it created .mha files, NOT .gipl.gz. Thus, when i tried to use the Shape Analysis Module with the correct input file including paths of the new .mha files, I received the same error as before:

ERROR: In /extra/pieper/slicer3/release/Slicer3/Modules/CommandLineModule/vtkCommandLineModuleLogic.cxx, line 1577
vtkCommandLineModuleLogic (0x76042c0): Shape Analysis Module terminated with a fault.


I think this is because the Shape Analysis Module does not read .mha files. Is there a way to convert .vtk to gipl.gz so that I can use the Shape Analysis Tool without error? I used Slicer v 3.6.3 and the Shape Analysis Module v 1.10.10.

Many thanks for your help,
Swati
Jul 14, 2011  12:07 PM | Beatriz Paniagua
RE: Using SPHARM-PDM on Slicer3 with vtk files
Hi Swati,


Have you indeed tested that you can open your mha? (if the process failed and you cant open it, ShapeAnalysisModule wont be able to open it either) Do they contain the information you expect them to?

If so, you can use ResampleVolume2, available in your Slicer3-3.6.3 distribution under (/yourSlicer/lib/Slicer3/Plugins/ResampleVolume2) that is a tool that converts volume files from every ITK compatible format to every ITK compatible format. Meaning you would have to type ResampleVolume2 yourfile.mha yourfile.gipl.gz to convert from one to the other.


Regards,
BEATRIZ
Jul 14, 2011  12:07 PM | Swati Chandhoke
RE: Using SPHARM-PDM on Slicer3 with vtk files
Hi Beatriz,

I attempted to open the mha file in Slicer3 using various options - including the Volumes Module and Transforms Module. Slicer was unable to read the mha file when trying to open it. However, in the error log, the process was completed without error (conversion using ParticleCorrespondencePreprocessing). Is there a reason why this would occur? 

I looked for ResampleVolume2 and it is indeed in the Slicer3 Plugins Folder, however it does not appear in the Modules when selecting All Modules in Slicer3. There are other modules which are similar such as Resample Surface Volume. Is there a way to make this work such that I can use the Resample Volume2 in the interactive version of Slicer3? If so, would this work to convert the mha files to gipl.gz?

Thanks for your help,
Swati
Jul 18, 2011  09:07 AM | Swati Chandhoke
RE: Using SPHARM-PDM on Slicer3 with vtk files
Hi Beatriz,

Just wondering if there was any update or insight regarding my earlier questions. Feel free to respond at your earliest convenience.

Best,
Swati
Jul 18, 2011  10:07 AM | Beatriz Paniagua
RE: Using SPHARM-PDM on Slicer3 with vtk files
Hi Swati,


I am not sure whether or not you can use ResampleVolume2 in Slicer implemented as a module. I was suggesting that option because is less cumbersome, you just have to type ResampleVolume2 ITKformatFile1 ITKformatFile2. If you are ok by using Slicer, you just can load your mha volume in slicer, and then save it as a gipl. Slicer does the change for you.
Does it make sense?


Regards,
BEATRIZ
Dec 18, 2017  07:12 PM | soda soda
RE: Using SPHARM-PDM on Slicer3 with vtk files
Hi Beatriz,
Sorry to bother you, I have a problem using the SPHARM-PDM on 3D Slicer(v4.4.0).
I follow the tutorial . I changed the filepath in the .csv file like this:

Gender InputFile1 Input File Description
0 /home/soda/Downloads/SPHARM_Tutorial_Data_July2015/origData/groupA_01_hippo.gipl.gz none
0 /home/soda/Downloads/SPHARM_Tutorial_Data_July2015/origData/groupA_02_hippo.gipl.gz none
1 /home/soda/Downloads/SPHARM_Tutorial_Data_July2015/origData/groupB_01_hippo.gipl.gz none
1 /home/soda/Downloads/SPHARM_Tutorial_Data_July2015/origData/groupB_02_hippo.gipl.gz none

but I got error when apply the shape analysis:

Shape Analysis Module terminated with a fault.

and here are more details:
Found CommandLine Module, target is /home/soda/.config/NA-MIC/Extensions-23774/SPHARM-PDM/lib/Slicer-4.4/cli-modules/ShapeAnalysisModule
ModuleType: CommandLineModule
Shape Analysis Module command line:

/home/soda/.config/NA-MIC/Extensions-23774/SPHARM-PDM/lib/Slicer-4.4/cli-modules/ShapeAnalysisModule --RescaleSegPostProcess --sx 0.5 --sy 0.5 --sz 0.5 --label 1 --NumberofIterations 1000 --SubdivLevelValue 10 --SPHARMDegreeValue 15 --thetaIterationValue 100 --phiIterationValue 100 --medialMesh --columVolumeFile 0 --varX 10 --varY 10 --varZ 10 --regTemplate None --flipTemplate None --paraOutTemplate --noFlip --HorizontalGridPara 5 --VerticalGridPara 5 --UseProcalign --startRegularization 10 --endRegularization 0.01 --optimizationIt 200 --RelativeWeight 1 /home/soda/Downloads/SPHARM_Tutorial_Data_July2015/origData/groupA_01_hippo.gipl.gz /home/soda/Downloads/SPHARM_Tutorial_Data_July2015/output
Shape Analysis Module standard output:
------ Shape Analysis Module start -----
Computing ShapeAnalysisModule...
/home/soda/Downloads/SPHARM_Tutorial_Data_July2015/output/
/home/soda/Downloads/SPHARM_Tutorial_Data_July2015/output/ShapeAnalysisModule.bms

Do you know how to fix it?
Thanks for your reply!