View Issue Details

IDProjectCategoryView StatusLast Update
0003256Slicer4Core: MRMLpublic2017-06-07 23:27
Reporterlassoan Assigned Tojcfr  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.3.0Fixed in VersionSlicer 4.3.0 
Summary0003256: vtkMRMLVolumeNode::SetIJKToRASDirections argument names are misleading
Description

From: slicer-devel-bounces@bwh.harvard.edu [mailto:slicer-devel-bounces@bwh.harvard.edu] On Behalf Of Yuzheng Zhou
Sent: July 26, 2013 11:28 PM
To: slicer-devel@bwh.harvard.edu
Subject: [slicer-devel] SetIJKToRASDirections setter methods in vtkMRMLVolumeNode

Hi,
In vtkMRMLVolumeNode.cxx, there are multiple setter methods for ITKToRASDirections. Based on the parameter names, they conflict with each other.
E.g.
https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Core/vtkMRMLVolumeNode.cxx#L264-266

https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Core/vtkMRMLVolumeNode.cxx#L278-280
Could anyone tell me which one is the correct so that I can fix the other one?
Thanks,
Yuzheng

TagsNo tags attached.

Relationships

related to 0003260 closedjcfr Volumes not marked as modified on Save after volume image spacing/origin is changed 

Activities

jcfr

jcfr

2013-07-26 13:57

administrator   ~0009222

From Andras:

Nice catch!

Functionally all those methods are correct, however the argument names in SetIJKToRASDirections are indeed incorrect (or at least misleading).

v_ras = T_ijk_to_ras*v_ijk

[v_r] [ Tir Tjr Tkr ] [ v_i ]
[v_a] = [ Tia Tja Tka ] * [ v_j ]
[v_s] [ Tis Tjs Tks ] [ v_k ]

Therefore, the correct SetIJKToRASDirections should be written as:

void vtkMRMLVolumeNode::SetIJKToRASDirections(double ir, double jr, double kr,
double ia, double ja, double ka,
double is, double js, double ks)
{
IJKToRASDirections[0][0] = ir;
IJKToRASDirections[0][1] = jr;
IJKToRASDirections[0][2] = kr;
IJKToRASDirections[1][0] = ia;
IJKToRASDirections[1][1] = ja;
IJKToRASDirections[1][2] = ka;
IJKToRASDirections[2][0] = is;
IJKToRASDirections[2][1] = js;
IJKToRASDirections[2][2] = ks;
}

pieper

pieper

2013-07-29 10:46

administrator   ~0009247

Agreed - good catch!

Yes, the {I,J,K}IToRASDirection vectors should be the direction in patient space when of stepping by one unit in {row, column, slice} pixel space.

Andras's fix looks right to me.

-Steve

yuzheng

yuzheng

2013-07-30 11:15

developer   ~0009281

Last edited: 2013-08-12 10:24

Fix is pushed here: https://github.com/yuzhengZ/Slicer/commit/a90f9de56ea1a4cafd0bb7410c6a406e760e68ec

jcfr

jcfr

2013-08-19 11:54

administrator   ~0009518

Fixed in r22298
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=22298

jcfr

jcfr

2014-03-06 05:22

administrator   ~0011170

Closing resolved issues that have not been updated in more than 3 months

jcfr

jcfr

2017-06-07 23:27

administrator   ~0014611

Fix committed to 2145-support-for-installing-extension-from-file branch.

Related Changesets

Slicer: 2145-support-for-installing-extension-from-file 748ecdbc

2013-08-19 15:53:40

jcfr

Details Diff
BUG: fix the misleading parameters in SetIJKToRASDirections.

Refactor setter methods SetIJKToRASDirections and fix its misleading parameters in vtkMRMLVolumeNode.
Fixes 0003256

From: Yuzheng Zhou <yuzheng.zhou@kitware.com>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@22298 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Libs/MRML/Core/vtkMRMLVolumeNode.cxx Diff File

Issue History

Date Modified Username Field Change
2013-07-26 13:48 lassoan New Issue
2013-07-26 13:48 lassoan Status new => assigned
2013-07-26 13:48 lassoan Assigned To => alexy
2013-07-26 13:54 yuzheng Assigned To alexy => yuzheng
2013-07-26 13:57 jcfr Note Added: 0009222
2013-07-26 13:58 jcfr Projection none => tweak
2013-07-26 13:58 jcfr ETA none => < 1 day
2013-07-26 13:58 jcfr Target Version => Slicer 4.3.0
2013-07-29 10:46 pieper Note Added: 0009247
2013-07-30 11:15 yuzheng Note Added: 0009281
2013-07-30 11:17 yuzheng Relationship added related to 0003260
2013-08-12 10:23 yuzheng Note Edited: 0009281
2013-08-12 10:24 yuzheng Note Edited: 0009281
2013-08-19 11:54 jcfr Note Added: 0009518
2013-08-19 11:54 jcfr Status assigned => resolved
2013-08-19 11:54 jcfr Fixed in Version => Slicer 4.3.0
2013-08-19 11:54 jcfr Resolution open => fixed
2014-03-06 05:22 jcfr Note Added: 0011170
2014-03-06 05:23 jcfr Status resolved => closed
2017-06-07 23:27 jcfr Changeset attached => Slicer 2145-support-for-installing-extension-from-file 748ecdbc
2017-06-07 23:27 jcfr Note Added: 0014611
2017-06-07 23:27 jcfr Assigned To yuzheng => jcfr