You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use the Slicer BRAINSResample interface and needed to make two main changes to the interface class definition:
The first change was to the command line string that is stored in the interface - right now it is just "BRAINSResample ". This does not work for me, even if my PATH environment variable points to the CLI module folder in Slicer (a library .so file is missing). I have to change it to "Slicer --launch BRAINSResample ", which seems to be in line with what the Slicer folks consider as a standard way to call these modules. Perhaps in older versions of Slicer, you can call the command line modules directly in the terminal without the "Slicer --launch"? So therefore:
Even though this worked for me, I don't know if the current nipype version works for most people, but I am inadvertently doing something else wrong, which is solved by this hack. Would all other command line modules in Slicer be affected in the same way?
My image filenames all have spaces in them, which mess up the argument parsing when the function is executed on the command line. On the command line outside nipype, the problem is avoided when there are quotation marks enclosing the pathname. Therefore I changed the argstr value whenever a File input is defined in BRAINSResampleInputSpec so that it will enclose the pathname with double quotes. For example, if the original code is:
class BRAINSResampleInputSpec(CommandLineInputSpec): inputVolume = File( desc="Image To Warp", exists=True, argstr="--inputVolume %s")
Then I change it to:
class BRAINSResampleInputSpec(CommandLineInputSpec): inputVolume = File( desc="Image To Warp", exists=True, argstr="--inputVolume \"%s\"")
The text was updated successfully, but these errors were encountered:
Can confirm that the latest Linux release of Slicer 4.11.20200930 is incompatible with latest nipype.interfaces.slicer, at least for many of the submodules. Attempting to run nipype.interfaces.slicer.generate_classes does not work.
Summary
I was trying to use the Slicer BRAINSResample interface and needed to make two main changes to the interface class definition:
_cmd = "BRAINSResample "
becomes_cmd = "Slicer --launch BRAINSResample "
Even though this worked for me, I don't know if the current nipype version works for most people, but I am inadvertently doing something else wrong, which is solved by this hack. Would all other command line modules in Slicer be affected in the same way?
class BRAINSResampleInputSpec(CommandLineInputSpec): inputVolume = File( desc="Image To Warp", exists=True, argstr="--inputVolume %s")
Then I change it to:
class BRAINSResampleInputSpec(CommandLineInputSpec): inputVolume = File( desc="Image To Warp", exists=True, argstr="--inputVolume \"%s\"")
The text was updated successfully, but these errors were encountered: