<html>
<body>
Problem:<br><br>
&nbsp;Using GDCMSeriesFileNames to search for volumes the Series<br>
&nbsp;Restriction should be this:<br>
&nbsp; &quot;0020|0052&quot; - Frame Of Reference (invalid coords if
changed)<br>
&nbsp; &quot;0020|000e&quot; - Series Instance UID (series defined by the
scanner)<br>
&nbsp; &quot;0020|0037&quot; - Patient Orientation<br><br>
&nbsp;The &quot;Patient Orientation&quot; is necessary since in MRI the
scout<br>
&nbsp;scan will create 3 volumes (axial, sagittal and coronal) into<br>
&nbsp;a singles series.<br><br>
&nbsp;But the GE scanner (NIH, Bethesda) created the following
Orientations:<br>
&nbsp;
-0.474171\0.877813\-0.0678738\0.117436\<b>-0.0133367</b>\-0.992991<br>
&nbsp;
-0.474171\0.877813\<b>-0.0678738</b>\0.117436\<b>-0.0133368</b>
\-0.992991<br>
&nbsp;
-0.474171\0.877813\<b>-0.0678739</b>\0.117436\-0.0133367\-0.992991<br>
&nbsp;so AddSeriesRestriction or SerieHelper::SplitOnOrientation
will<br>
&nbsp;split this single volume into multiple (sub) volumes.<br><br>
&nbsp;The problem is due to rounding error in the GE scanner, but
the<br>
&nbsp;float/double variable is known to not be precise for == type<br>
&nbsp;comparisons. (Floating point is implemented using fractional<br>
&nbsp;powers of 2, so it is an approximation of the real value.)<br><br>
<br>
Solution:<br><br>
&nbsp;AddSeriesRestriction is not a solution, since the Orientation
is<br>
&nbsp;written in 0020 0037 or 0020 0035 - and it would not be a
generic<br>
&nbsp;solution anyway.<br><br>
&nbsp;GDCM SerieHelper::SplitOnOrientation can be used if it will crop
the<br>
&nbsp;last decimal of the cosines strings. Something like this:<br><br>
&nbsp;std::string CropLastDecimal(std::string s)<br>
&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp; if ( s.size() &lt; s.find_first_of('.')+1 )<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return s.substr(0,
s.size()-1);<br>
&nbsp;&nbsp;&nbsp;&nbsp; return s;<br>
&nbsp;}<br><br>
&nbsp;called for each element of the cosines matrix.<br><br>
&nbsp;Sure this could be made into a more robust solution (compare
with<br>
&nbsp;&quot;abs&quot; in floating or double variable level) in long
run.<br><br>
Csaba<br><br>
<br>
<x-sigsep><p></x-sigsep>
Csaba Csoma<br>
Systems Engineer<br>
------------------------<br>
Johns Hopkins University<br>
3400&nbsp; North Charles Str.<br>
B26 New Engineering Bldg<br>
Baltimore, MD 21218-2682<br>
Phone: (410) 516-4991<br>
<a href="mailto:csoma@jhu.edu" eudora="autourl">mailto:csoma@jhu.edu<br>
</a></body>
</html>