<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap:break-word; color:rgb(0,0,0); font-size:14px; font-family:Calibri,sans-serif">
<div>Stefan,</div>
<div><br>
</div>
<div>Upon limited quick first look, that seems suspicious. I'll be honest though, it is unlikely that the core ITK development team will be able to address this issue quickly.</div>
<div><br>
</div>
<div>The main problem is that we don't know what your looks like, and it is really hard to diagnose this problems blindly.</div>
<div><br>
</div>
<div>I would suggest that you propose a patch that fixes the problem, and provide an example data sets that shows how the problem existed, and how it is fixed. That way we can quickly evaluate and approve/improve/resolve your recommended solution.</div>
<div><br>
</div>
<div>Regards,</div>
<div><br>
</div>
<div>Hans</div>
<div><br>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; border-bottom:medium none; border-left:medium none; padding-bottom:0in; padding-left:0in; padding-right:0in; border-top:#b5c4df 1pt solid; border-right:medium none; padding-top:3pt">
<span style="font-weight:bold">From: </span>Stefan Klein <<a href="mailto:s.klein@erasmusmc.nl">s.klein@erasmusmc.nl</a>><br>
<span style="font-weight:bold">Date: </span>Fri, 24 Feb 2012 15:01:30 +0100<br>
<span style="font-weight:bold">To: </span>ITK <<a href="mailto:insight-developers@itk.org">insight-developers@itk.org</a>><br>
<span style="font-weight:bold">Subject: </span>[Insight-developers] Fwd: nifti direction cosines; bug?<br>
</div>
<div><br>
</div>
<div>
<div bgcolor="#FFFFFF">Hi all,<br>
Could anybody of NiftiImageIO-developers confirm that the behaviour described below is indeed a bug, and was not intentional?<br>
Kind regards,<br>
Stefan<br>
<br>
-------- Original Message --------
<table class="moz-email-headers-table" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">Subject: </th>
<td>[Insight-developers] nifti direction cosines; bug?</td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">Date: </th>
<td>Fri, 10 Feb 2012 19:44:54 +0100</td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">From: </th>
<td>Stefan Klein <a class="moz-txt-link-rfc2396E" href="mailto:s.klein@erasmusmc.nl">
<s.klein@erasmusmc.nl></a></td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">To: </th>
<td>Insight Developers <a class="moz-txt-link-rfc2396E" href="mailto:insight-developers@itk.org">
<insight-developers@itk.org></a></td>
</tr>
</tbody>
</table>
<br>
<br>
<pre>Hi developers,
In case of an Analyze75 file, loaded by NiftiImageIO, the Direction
Cosines are not stored in the m_Direction variable. Consequently, all
Analyze files get an identity direction matrix.
The error occurs in the SetImageIOOrientationFromNifTI function. The
code first reads the orientation correctly and stores it in a local
variable called 'dir', but this variable is never stored in the member
variable m_Direction.
Here is the relevant code (ITK v4.1rc01):
void
NiftiImageIO::SetImageIOOrientationFromNIfTI(unsigned short int dims)
{
typedef SpatialOrientationAdapter OrientAdapterType;
//
// in the case of an Analyze75 file, use old analyze orient method.
if ( this->m_NiftiImage->qform_code == 0
&& this->m_NiftiImage->sform_code == 0 )
{
SpatialOrientationAdapter::DirectionType dir;
SpatialOrientationAdapter::OrientationType orient;
switch ( this->m_NiftiImage->analyze75_orient )
{
case a75_transverse_unflipped:
orient = SpatialOrientation::ITK_COORDINATE_ORIENTATION_RPI;
break;
case a75_sagittal_unflipped:
orient = SpatialOrientation::ITK_COORDINATE_ORIENTATION_PIR;
break;
// according to analyze documents, you don't see flipped
// orientation in the wild
case a75_transverse_flipped:
case a75_coronal_flipped:
case a75_sagittal_flipped:
case a75_orient_unknown:
case a75_coronal_unflipped:
orient = SpatialOrientation::ITK_COORDINATE_ORIENTATION_RIP;
break;
}
dir = OrientAdapterType().ToDirectionCosines(orient);
m_Origin[0] = 0;
if ( dims > 1 )
{
m_Origin[1] = 0;
}
if ( dims > 2 )
{
m_Origin[2] = 0;
}
return;
}
... // implementation for non-Analyze files.
}
I'm aware that Analyze75 is deprecated, and that I could use the
Deprecated/itkAnalyzeImageIO.h class, but this looks to me like a bug.
Kind regards,
Stefan
--
Stefan Klein
+31 10 7043049
<a class="moz-txt-link-freetext" href="http://www.bigr.nl/people/StefanKlein">http://www.bigr.nl/people/StefanKlein</a>
_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Kitware offers ITK Training Courses, for more information visit:
<a class="moz-txt-link-freetext" href="http://kitware.com/products/protraining.html">http://kitware.com/products/protraining.html</a>
Please keep messages on-topic and check the ITK FAQ at:
<a class="moz-txt-link-freetext" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.itk.org/mailman/listinfo/insight-developers">http://www.itk.org/mailman/listinfo/insight-developers</a></pre>
</div>
</div>
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at
<a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a> Kitware offers ITK Training Courses, for more information visit:
<a href="http://kitware.com/products/protraining.html">http://kitware.com/products/protraining.html</a> Please keep messages on-topic and check the ITK FAQ at:
<a href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a> Follow this link to subscribe/unsubscribe:
<a href="http://www.itk.org/mailman/listinfo/insight-developers">http://www.itk.org/mailman/listinfo/insight-developers</a>
</span><br>
<br>
<hr>
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any
retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you.
<hr>
</body>
</html>