<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); ">
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">I have a question about the SetDirection member function of the itkImageBase class. I am attempting to pass image data that is stored in a column major convention to ITK, which is row major. I
start with a given definition of X and Y in the column major environment with X pointing in the direction of increasing column indices and Y pointing in the direction of increasing row indices. I want to keep the same coordinate system convention relative
to my image data when I construct my images in ITK.</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">To accomplish this, I believe I want to swap the X and Y direction definitions on my itkImage object as follows:</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">
<div> typename imageType::DirectionType direction = image->GetDirection();</div>
<div> </div>
<div> direction[0][0] = 0;</div>
<div> direction[0][1] = 1;</div>
<div> direction[1][0] = 1;</div>
<div> direction[1][1] = 0;</div>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">
<div> image->SetDirection(direction);</div>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">My question is regarding the SetSpacing and SetOrigin methods of the ITKImage object. The documentation for each member function reads:</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">SETORIGIN</div>
<div>
<p style="font-weight: normal; font-style: normal; font-variant: normal; font-size: 12px; line-height: 19px; font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; color: rgb(0, 0, 0); letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">
Set the origin of the image. The origin is the geometric coordinates of the image origin (pixel [0,0]). It is stored internally as double but may be set from float.</p>
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">SETSPACING</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span style="color: rgb(0, 0, 0); font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">Set
the spacing (size of a pixel) of the image. The spacing is the geometric distance between image samples along each dimension. It is stored internally as double, but may be set from float. These methods also pre-compute the </span><a class="el" href="http://www.itk.org/Doxygen/html/classitk_1_1Index.html" title="Represent a n-dimensional index in a n-dimensional image." style="color: rgb(70, 101, 162); font-weight: bold; text-decoration: initial; font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">Index</a><span style="color: rgb(0, 0, 0); font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; "> to
Physical point transforms of the image.</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span style="color: rgb(0, 0, 0); font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; "><br>
</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span style="color: rgb(0, 0, 0); font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(254, 255, 254); font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">After
I set direction, I call SetOrigin and SetSpacing. Do SetOrigin and SetSpacing expect the origin and spacing in [X Y] order, or are they in the order [SpacingAlongRows, SpacingAlongColumns], [RowOrigin ColumnOrigin]?</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span style="color: rgb(0, 0, 0); font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(254, 255, 254); font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; "><br>
</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span style="color: rgb(0, 0, 0); font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(254, 255, 254); font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> typename imageType::DirectionType direction = image->GetDirection();</div>
</span><span style="color: rgb(0, 0, 0); font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(254, 255, 254); font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">
<div style="font-family: Calibri, sans-serif; font-size: 14px; display: inline !important; ">
direction[0][0] = 0;</div>
</span><span style="color: rgb(0, 0, 0); font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(254, 255, 254); font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; "><span class="Apple-style-span" style="font-family: Calibri, sans-serif; font-size: 14px; line-height: normal; "><span style="color: rgb(0, 0, 0); font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(254, 255, 254); font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">
<div style="font-family: Calibri, sans-serif; font-size: 14px; display: inline !important; ">
</div>
</span></span>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> direction[0][1] = 1;</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> direction[1][0] = 1;</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> direction[1][1] = 0;</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> image->SetDirection(direction);</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> </div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> // Set the origin and inter pixel spacing.</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> image->SetOrigin(origin); </div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> image->SetSpacing(spacing);</div>
</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span style="color: rgb(0, 0, 0); font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(254, 255, 254); font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; "><br>
</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span style="color: rgb(0, 0, 0); font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(253, 255, 253); font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; ">I'm
seeing some strange behavior in which the numerics of my registration result are changing as a result of redefining which direction is considered X and which direction is considered Y, with all of the other inputs to registration changed to be consistent with
the new X Y definition. I'm wondering whether I'm calling SetOrigin/SetSpacing correctly.</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span style="color: rgb(0, 0, 0); font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 19px; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; background-color: rgb(253, 255, 253); font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; "><br>
</span></div>
<div><font class="Apple-style-span" face="Lucida Grande,Verdana,Geneva,Arial,sans-serif"><span class="Apple-style-span" style="font-size: 12px; line-height: 19px; ">Thanks,</span></font></div>
<div><font class="Apple-style-span" face="Lucida Grande,Verdana,Geneva,Arial,sans-serif"><span class="Apple-style-span" style="font-size: 12px; line-height: 19px;"><br>
</span></font></div>
<div><font class="Apple-style-span" face="Lucida Grande,Verdana,Geneva,Arial,sans-serif"><span class="Apple-style-span" style="font-size: 12px; line-height: 19px;">Alex Taylor</span></font></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<dl class="section see" style="font-weight: normal; font-style: normal; font-variant: normal; font-size: 12px; line-height: 19px; font-family: 'Lucida Grande', Verdana, Geneva, Arial, sans-serif; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-left: 0px; color: rgb(0, 0, 0); letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">
</dl>
</div>
</body>
</html>