Swiss Skull Stripper: troubles invoking from python console

Hi everyone!

I’m trying to run the Swiss Skull Stripper from script and I’m getting this error every time:


"Swiss Skull Stripper standard error:

Exception caught !

itk::ImageFileReaderException (0000001D6C5BD080)
Location: "unknown"
File: c:\d\p\slicer-462-package\itkv4\modules\io\imagebase\include\itkImageFileReader.hxx
Line: 87
Description: FileName must be specified


I’m trying to figure out if there’s an error with parameters when invoking the module. I’m using this (in this order):
’’‘
parameters = {}
1. "atlasImage"
2. "atlasMask"
3. “patientVolume” 3
4. “patientOutputVolume” 4
5. “patientMaskLabel” 5
’’'
I’m running the module:
sss = slicer.modules.swissskullstripper
return (slicer.cli.run(sss, None, parameters))

Anyone have any idea!?

Thanks in advance!! :smiley:

One of the required inputs are not specified in parameters variable, probably because you use incorrect parameter name. Parameter names can be printed using the script here: https://www.slicer.org/wiki/Documentation/Nightly/Developers/Python_scripting#Running_a_CLI_from_Python

Parameter (0/0): atlasMRIVolume (Atlas Volume)
Parameter (0/1): atlasMaskVolume (Atlas Mask Volume)
Parameter (1/0): patientVolume (Patient Volume)
Parameter (2/0): patientOutputVolume (Patient Output Volume)
Parameter (2/1): patientMaskLabel (Patient Mask Label)

1 Like

Sometimes I get itkImageFileReader error in Linux because:

  • The path or the file name contains spaces or special characters.
  • Don’t have permission to access the file.
    Good luck!
1 Like

Thanks for answering!!

that is the piece of code I’m using, but still not working!

I get your point, though. I’m loading/creating this four parameters (atlasMRIVolume, atlasMaskVolume, patientOutputVolume and patientMaskLabel) but for the patient volume I am just getting the ID:

(parameters[“patientVolume”] = volumeNode.GetID())

I don’t know if (maybe) I should perform any other instruction before setting this volume to the parameters.

Do you know where can I find documentation about swiss skull stripping module?

I’ll keep trying :slight_smile:

Again thanks for tip :+1:

hey!! Thanks brhoom!

I’ll double check the syntaxis again :slight_smile:

thankks!! :+1:

Hi again!!

So after almost a week…I haven’t been able to invoke the module without an error.

Does anyone know where can I found some documentation about the skull stripper or the swiss skull stripper?? I would really appreciate it.

Another way to find out what I need (what to pass as to the function!!!) would be to read the source code of the swissskullstripper module. Any idea how to do that???

<>Desperate :frowning: <>

Thank you all!

We’ve updated SkullStripper, it should be very easy to use now.

Slicer download page doesn’t show the latest version so you have to download the latest version of Slicer from the dashboard (small yellow icon in the Build Name column): http://slicer.cdash.org/index.php?project=Slicer4

1 Like

wow!!
Ok, I’ll update the Slicer.
I’m trying to write a script for the python console: do you know what do I need to define and how to invoke (parameters needed) the skullstripper module :slight_smile: ???

Thanks in advance lassoan :sunny:

First use it from the GUI. Everything should be self-explaining. If not, then ask here.

If it works well, then follow instructions for how to call a CLI from Python.

1 Like

hi again!

I appreciate the guidance…I already tested the GUI -and the results are quite interesting. I’ve tested the stripping changing parameters for different sets of images and now I would like to set all this values from the command line. Thanks for linking again the “Running a CLI from Python” code. I assure you that I have almost learnt those lines…the problem is, as you might be already guessing, that the parameters required for the Skull Stripping are not “Input Volume” and “Output Geometry” (as shown in the linked example). That’s what I’m looking for…some kind of documentation about the use of this module.

Thanks lassoan. I really appreciate the time you’re taking to help me out. :muscle: :wink:

Hi,

If not already done, consider looking at the module documentation, you can find there some example of atlases:

https://www.slicer.org/wiki/Documentation/Nightly/Modules/SwissSkullStripper

Looking at the description of its parameters could also be helpful:

https://github.com/lorensen/SwissSkullStripperExtension/blob/master/SwissSkullStripper/SwissSkullStripper.xml