[slicer-users] How to specify multiple images as input parameters for a command line module?

Haiyong Xu haiyeong at gmail.com
Mon Dec 20 15:41:54 EST 2010


Thanks Nicole and Jim. It would be great if Slicer4 CLI can support
multiple input images.

I built Slicer-3.6.2 from svn source. In a module GUI I developed, I
use node's name to retrieve a group of vtkMRMLScalarVolumeNode as
input images. When loading volumes, I use the same name (Slicer nodes
can have the same NodeName even there NodeId are different). This is
useful feature when there are a lot of images in a group, e.g., >100.
The new widget should have the capability to specify multiple input
images using NodeName besides NodeId.

Haiyong


On Mon, Dec 20, 2010 at 11:59 AM, Jim Miller <millerjv at ge.com> wrote:
> Nicole's assessment is correct.
> We essentially need a new widget to allow multiple nodes to be selected.  I
> had played around with writing one in KWWidgets but shelved it when the Qt
> version of Slicer started.
> A short "hack" when multiple="true" is set would be to allow the user to add
> additional node selector widgets.  Something like "right-click" on parameter
> -> pop-up menu -> "Add selector" (or "Remove selector").  This would allow
> the user to keep adding node selectors (and removing extras) to set the
> additional inputs. I guess this approach could be used for any
> multiple="true" parameter.....
> Again, for either a new widget or the "Add selector" approach, I would put
> it in Slicer4.
> Jim
>
>
> On Dec 20, 2010, at 11:47 AM, Nicole Aucoin wrote:
>
> After taking a look at the code, this isn't a simple fix. The main issue is
> that the vtkSlicerNodeSelectorWidget only uses radio buttons rather than
> check buttons, so it doesn't support selecting multiple nodes. The command
> line module logic and gui building code continue this assumption. Changing
> this is going to be a fair sized project and I suspect that it will get
> pushed into Slicer4, I should be able to bring this up at our next
> engineering teleconference after the holidays but I'll at least update the
> execution model documentation.
>
> Using the CLI infrastructure, having an unspecified number of input volumes
> isn't supported right now, so your best bet for a flexible groupwise
> registration module would be to write a loadable module where you write your
> own GUI (questions about that can go to the slicer-devel mailing list).
> Otherwise, capping the the number of input volumes and manually adding each
> as an input parameter will allow you to continue using the CLI
> infrastructure.
>
> Nicole
>
> Nicole Aucoin wrote:
>
> I just tried this out by adding a new multiple image parameter to one of my
> CLI modules, thinking that the node selector widget would allow me to select
> multiple volumes from the drop down menu (Slicer3 svn trunk on linux64), but
> I wasn't able to get that to work.  The documentation says that it's
> supported, so I'll take a look at the code and see if there's something
> missing in the command line module GUI.
>
> The only work around I can think of right now is making separate image input
> parameters for each input volume, adding more than you think you'll need and
> checking in the code for valid file names.  Are you building Slicer from
> source or using a nightly build or binary release?
>
> Nicole
>
> Haiyong Xu wrote:
>
>
>
> Hi slicer-users,
>
> I developed a command line module which takes multiple images as input
>
> parameters. Following is the "InputVolumes" parameter in the XML file:
>
> "    <image multiple=\"true\">\n"
>
> "      <name>InputVolumes</name>\n"
>
> "      <label>Input Volumes</label>\n"
>
> "      <channel>input</channel>\n"
>
> "      <flag>i</flag>\n"
>
> "      <longflag>input</longflag>\n"
>
> "      <description></description>\n"
>
> "    </image>\n"
>
> In a console window, I can run the program with multiple "--input"
>
> flags in order to provide multiple input images. For example:
>
> [...] $ ./GroupwiseRegistration --input  1.nrrd --input  2.nrrd
>
> --input  3.nrrd ...
>
> In Slicer GUI, there is only one widget (vtkSlicerNodeSelectorWidget)
>
> corresponding to the "InputVolumes" parameter. My question is how to
>
> specify multiple input images in that widget. Appreciate any
>
> suggestions or discussions.
>
> Regards,
>
> Haiyong
>
>
>
>
> Jim Miller
> Senior Scientist
> GE Research
> Interventional and Therapy
> GE imagination at work
>



More information about the slicer-users mailing list