View Issue Details

IDProjectCategoryView StatusLast Update
0002979Slicer4Core: CLI infrastructurepublic2018-03-02 11:06
Reporterymartelli Assigned Tonicole  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product VersionSlicer 4.2.2-1 
Target VersionSlicer 4.5.0-1Fixed in VersionSlicer 4.5.0-1 
Summary0002979: Support for CLI point coordinateSystem
Description

The flag 'coordinateSystem' of the <point> tag does not have any effect, neither in the Slicer 4.2.2 GUI, nor in the generated command line. The documentation says that 'ras', 'lps' and 'ijk' are supported (http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation#XML_Schema) but points always come in RAS coordinates.

This was also reported on the mailing list: http://massmail.spl.harvard.edu/public-archives/slicer-users/2010/002850.html

TagsNo tags attached.

Activities

jcfr

jcfr

2013-02-25 06:14

administrator   ~0008037

@Jim: Could you have a look ? Thanks

millerjv

millerjv

2013-02-25 09:26

developer   ~0008040

The original design was to support multiple coordinate systems. But the implementation became Slicer specific with an implicit assumption of RAS.

It is something that we have intended to revisit. Nicole want to revisit how we communicate points to a CLI, coordinating with that effort would be a good opportunity.

jcfr

jcfr

2013-02-25 09:34

administrator   ~0008041

Last edited: 2013-02-25 09:34

@Jim: Thanks for the quick answer.

@Yves: Assuming Jim or Nicole provides you with some guidance, would you be willing to help addressing this problem by contributing a patch ?

ymartelli

ymartelli

2013-02-25 23:13

reporter   ~0008046

If I can be of any help. Can you tell me roughly where to look for in the Slicer code? The plan would be to convert to the desired coordinate system when the command line is generated? I was wondering if it made sense to pass landmarks in a coordinate system when the data is in another?

millerjv

millerjv

2013-02-26 03:37

developer   ~0008047

It is tricky. Basically Slicer does everything in RAS. But ITK does everything in LPS. When images are written to disk, Slicer converts its coordinate frame into a a coordinate frame compatible with the file format. When an CLI based on ITK reads that data in, the CLI converts the data to LPS. This same conversion occurs when sending images in memory to CLI as well.

But for points, we don't have file format standards defining the coordinate frame of the serialized data. Originally we passed points on the command line. So we planned at attribute in the <point> tag to define what coordinate frame the plugin is expecting the data.

Currently plugins receive points in RAS and convert them to LPS internally if needed.

Here are some options:

  1. Relieve the plugin of the burden of doing the coordinate frame translation and have Slicer do it. We will have to take a careful look at all the plugin modules that take points and determine whether they now need to specify a coordinate frame or whether code needs to be removed from the plugins to do the conversion.

  2. Use a file format for sending points that defines (explicitly or implicitly) a coordinate frame. Then follow the paradigm established for images.

We need to do 0000002 anyway, as we have modules that need to receive a collection of points larger than we want to put on the command line.

But I expect for backward compatibility, we will maintain 0000001 is some capacity as it is useful for passing seed points and query points.

Let's pull Nicole into the discussion as her plans for points will impact how we resolve this.

nicole

nicole

2013-03-13 13:44

administrator   ~0008120

My plan is to move toward 2, using a file format that can pass multiple points. I think I prefer that Slicer does the conversion before passing the points to the CLIs so that they can just specify the coordinate system and then read the points without having to do a conversion.

For reference, these CLI's currently use the point parameter and some are expecting LPS coordinates:
./ExecutionModelTour/ExecutionModelTour.xml: <point multiple="true" coordinateSystem="ras">
./FreesurferSurfaceSectionExtraction/FreesurferSurfaceSectionExtraction.xml: <point multiple="true">
./FreesurferSurfaceSectionExtraction/FreesurferSurfaceSectionExtraction.xml: <point multiple="true">
./ResampleDTIVolume/ResampleDTIVolume.xml: <point multiple="false" coordinateSystem="lps">
./ResampleDTIVolume/ResampleDTIVolume.xml: <point multiple="false" coordinateSystem="lps">
./ACPCTransform/ACPCTransform.xml: <point multiple="true" coordinateSystem="ras">
./ACPCTransform/ACPCTransform.xml: <point multiple="true" coordinateSystem="ras">
./ExpertAutomatedRegistration/ExpertAutomatedRegistration.xml: <point multiple="true">
./ExpertAutomatedRegistration/ExpertAutomatedRegistration.xml: <point multiple="true">
./SimpleRegionGrowingSegmentation/SimpleRegionGrowingSegmentation.xml: <point multiple="true" coordinateSystem="ras">
./FiducialRegistration/FiducialRegistration.xml: <point multiple="true">
./FiducialRegistration/FiducialRegistration.xml: <point multiple="true">
./ResampleScalarVectorDWIVolume/ResampleScalarVectorDWIVolume.xml: <point multiple="false" coordinateSystem="lps">
./ResampleScalarVectorDWIVolume/ResampleScalarVectorDWIVolume.xml: <point multiple="false" coordinateSystem="lps">

jcfr

jcfr

2013-03-19 11:38

administrator   ~0008165

Would it also make sens to associated the "coordinateSystem" attribute with image input/output also ?

pieper

pieper

2013-07-04 10:51

administrator   ~0008833

Will this be fixable for the 4.3 release? Several people have asked about it.

nicole

nicole

2013-07-08 06:18

administrator   ~0008876

I was actually just working on a get markup point as LPS method late last week and was going to debug it today to get it into the Markups check in. The way I went was:
adding a flag to the markups storage node UseLPS. If it's true, the storage node writes the file in LPS coordinates, and the markups node will write the points to a CLI parameter list in LPS. I haven't hooked up the command line module logic to trigger this yet though.

Short answer: yes, for markup fiducials.

nicole

nicole

2013-07-08 09:58

administrator   ~0008895

Last edited: 2013-07-08 12:07

Have the LPS option done locally to markups, but will postpone the IJK one, as it will rely on having an associated node id set for each fiducial point, looking up that volume and doing the RAS to IJK conversion on write/read. If IJK output is critical, I can work on it during the bug fixing phase.

To have the CLI use the LPS functionality will work best if the coordinate system selection is defined on the vtkMRMLStorageNode level, otherwise I'm going to have to expand the WriteCLI call on the displayable nodes. There's also the to do point of expanding the point SEM type to support the fileExtension option to use the storage nodes to write files.

Jim, can you weigh in?

nicole

nicole

2013-07-08 14:16

administrator   ~0008915

Added a coordinate system flag to the WriteCLI method and use it for annotation points, see the changes here:
https://github.com/naucoin/Slicer/commit/4a0adfa98bbdeed79fe5732f3097ce361a64dfdd

nicole

nicole

2013-08-30 07:43

administrator   ~0009726

Support for LPS and RAS annotation/markup points is in the Slicer code base for the 4.3 release.
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;revision=22311
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;revision=22319
(with a small bug fix coming)

pieper

pieper

2014-03-06 09:45

administrator   ~0011247

Is this ready to move.

nicole

nicole

2015-01-08 05:43

administrator   ~0012859

Consider supporting --pointfile to write fiducials via file to CLI modules, and get them back, while still supporting individual command line --point (multi supported) for backward compatibility. Look at expanding PARSE_ARGS to do the reading automatically (as a backward compatibility option so that the points would be in the standard array)? If go the PARSE_ARGS way, deprecate the generation of individual points on the command line. The CLI developer would have to write it manually then though if they wanted to return changed points to Slicer.
Might make this a Summer 15 project week project.

nicole

nicole

2015-06-24 02:36

administrator   ~0013148

Slicer execution model changes:
https://github.com/naucoin/SlicerExecutionModel/tree/2979-support-for-cli-point-coordinateSystem-files
Slicer changes (pending upload from NAMIC project week):
https://github.com/naucoin/Slicer/tree/2979-support-for-cli-point-coordinateSystem-files

jcfr

jcfr

2015-06-24 04:24

administrator   ~0013149

Thanks Nicole.

Within the SlicerExecutionModel, could you add a simple test case to: https://github.com/naucoin/SlicerExecutionModel/blob/2979-support-for-cli-point-coordinateSystem-files/ModuleDescriptionParser/Testing/ModuleDescriptionTest.cxx

nicole

nicole

2015-06-24 06:55

administrator   ~0013152

Last edited: 2015-06-24 06:56

Trying, but the WriteParameterFile method don't seem to be fully implemented in ModuleDescription. It just produces key = value lines for the top level parameter (though that matches what the Read method expects):

cat /Users/nicole/github/SlicerExecutionModel/ModuleDescriptionParser/Testing/TestData/parameter-file-with-pointfile-slicer-issue2979.params
Input Fiducial File = input.fcsv
Output Fiducial File = output.fcsv

nicole

nicole

2015-06-24 07:30

administrator   ~0013153

Did a simple module description parser test and a more extensive XML file test for point and pointfile.
https://github.com/naucoin/SlicerExecutionModel/commit/d7d3c9c1b9cdf659319c1f11f33e7765d5edd0e7

nicole

nicole

2015-07-06 12:10

administrator   ~0013171

Execution model pull request:
https://github.com/Slicer/SlicerExecutionModel/pull/43
Once that's been integrated, will do a pull request for the Slicer changes.

nicole

nicole

2015-07-16 13:45

administrator   ~0013185

SEM pull request integrated.
https://github.com/Slicer/SlicerExecutionModel/commit/608c7b06f9402b35f0ec01550a3b9e313582f683

nicole

nicole

2015-07-16 14:19

administrator   ~0013186

Slicer pull request:
https://github.com/Slicer/Slicer/pull/307

jcfr

jcfr

2015-07-16 14:42

administrator   ~0013187

+1 Thanks Nicole. I added comment on the PR.

nicole

nicole

2015-07-21 13:46

administrator   ~0013190

Integrated as of svn 24459
http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;revision=24459

Related Changesets

Slicer: 2145-support-for-installing-extension-from-file 0c1a0975

2013-08-22 20:32:36

naucoin

Details Diff
ENH: Add support for the LPS coordinate system for CLIs

Add a coordinate system flag check, default to ras but support LPS.

Update the displayable nodes that use the WriteCLI method to
use the coordinate system flag.

TODO: IJK coordinate system - See issue 0002979

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22311 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Libs/MRML/Core/vtkMRMLDisplayableNode.h Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationControlPointsNode.cxx Diff File
mod - Modules/Loadable/Annotations/MRML/vtkMRMLAnnotationControlPointsNode.h Diff File

Issue History

Date Modified Username Field Change
2013-02-24 23:20 ymartelli New Issue
2013-02-24 23:20 ymartelli Status new => assigned
2013-02-24 23:20 ymartelli Assigned To => millerjv
2013-02-25 06:14 jcfr Note Added: 0008037
2013-02-25 09:26 millerjv Note Added: 0008040
2013-02-25 09:34 jcfr Note Added: 0008041
2013-02-25 09:34 jcfr Note Edited: 0008041
2013-02-25 23:13 ymartelli Note Added: 0008046
2013-02-26 03:37 millerjv Note Added: 0008047
2013-03-13 13:44 nicole Note Added: 0008120
2013-03-19 11:38 jcfr Note Added: 0008165
2013-07-04 10:51 pieper Note Added: 0008833
2013-07-08 06:18 nicole Note Added: 0008876
2013-07-08 09:58 nicole Note Added: 0008895
2013-07-08 10:39 nicole Note Edited: 0008895
2013-07-08 12:07 nicole Note Edited: 0008895
2013-07-08 14:16 nicole Note Added: 0008915
2013-08-30 07:43 nicole Note Added: 0009726
2013-08-30 07:52 jcfr Target Version => Slicer 4.4.0
2014-03-06 09:45 pieper Note Added: 0011247
2014-07-29 11:44 jcfr Target Version Slicer 4.4.0 => Slicer 4.5.0-1
2014-07-29 11:44 jcfr Assigned To millerjv => nicole
2015-01-08 05:43 nicole Note Added: 0012859
2015-06-24 02:36 nicole Note Added: 0013148
2015-06-24 04:24 jcfr Note Added: 0013149
2015-06-24 06:55 nicole Note Added: 0013152
2015-06-24 06:56 nicole Note Edited: 0013152
2015-06-24 07:30 nicole Note Added: 0013153
2015-07-06 12:10 nicole Note Added: 0013171
2015-07-16 13:45 nicole Note Added: 0013185
2015-07-16 14:19 nicole Note Added: 0013186
2015-07-16 14:42 jcfr Note Added: 0013187
2015-07-21 13:46 nicole Note Added: 0013190
2015-07-21 13:46 nicole Status assigned => resolved
2015-07-21 13:46 nicole Fixed in Version => Slicer 4.4.1
2015-07-21 13:46 nicole Resolution open => fixed
2015-09-09 08:29 jcfr Fixed in Version Slicer 4.4.1 => Slicer 4.5.0-1
2017-06-07 23:27 Changeset attached => Slicer 2145-support-for-installing-extension-from-file 0c1a0975
2018-03-02 11:06 jcfr Status resolved => closed