Hi there,<br>I changed the images pixel type , to unsigned long , and almost solved the problem. Now in the first image pair the output image has values from 0-1318 and in the second image pair from 0-360, although it is not exactly the same.<br>
I had problem though in registering the images (through imageregistration8.cxx), because it didnt performed the right scaling correction.<br>Any help in that?<br>Thanks,<br>Giorgos<br><br><div class="gmail_quote">On Wed, Apr 2, 2008 at 1:40 PM, Giorgos Pichis &lt;<a href="mailto:gpichis@gmail.com">gpichis@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Hi there,<br>I tried to solve the problem using RescaleIntensityImageFilter but it didnt fix the problem.<br>
The input image has greylevel values from 0-1362 and the output image from 0-220.<br>In another example input image had values from 0-376 and the output from 0-241. <br>
it seems that the writer by default writes the images in the scale 0-255, but rescaling to 0-512 or 0-1024 didnt fix the problem<br><br>Thanks , <br><font color="#888888">Giorgos</font><div><div></div><div class="Wj3C7c">
<br><br><div class="gmail_quote">On Tue, Apr 1, 2008 at 11:48 AM, Oliver Trebbe &lt;<a href="mailto:otrebbe@uni-muenster.de" target="_blank">otrebbe@uni-muenster.de</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi there,<br>
I think i also have the same Problem.<br>
After filtering and resampling my greylevel scale reached form ~ -30000 to ~+30000.<br>
Im also a little bit confused (tried to change the input pixel types, but that didnt work:))<br>
But i also use the RescaleIntensityImageFilter.<br>
Maybe this can help solving the problem.<br>
<br>
Greatings<br>
Oliver<br>
<br>
<br>
Giorgos Pichis schrieb:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div>
Hi Luis,<br>
Here is the code I used. It is the example ResampleImageFilter5 with a change in the transform.<br>
The images were dicom mammography 3d images.<br>
The same problem appeared when I used .vtk 3d images . I didnt changed<br>
the input and output pixel type<br>
<br>
Thanks ,<br>
Giorgos<br>
<br>
<br>
#include &quot;itkImage.h&quot;<br>
#include &quot;itkImageFileReader.h&quot;<br>
#include &quot;itkImageFileWriter.h&quot;<br>
#include &quot;itkResampleImageFilter.h&quot;<br>
#include &quot;itkLinearInterpolateImageFunction.h&quot;<br>
#include &quot;itkSimilarity3DTransform.h&quot;<br>
<br>
int main( int argc, char * argv[] )<br>
{<br>
 &nbsp;if( argc &lt; 5 )<br>
 &nbsp; &nbsp;{<br>
 &nbsp; &nbsp;std::cerr &lt;&lt; &quot;Usage: &quot; &lt;&lt; std::endl;<br>
 &nbsp; &nbsp;std::cerr &lt;&lt; argv[0] &lt;&lt; &quot; &nbsp;inputImageFile &nbsp;outputImageFile &nbsp;degrees &nbsp;scale&quot; &lt;&lt; std::endl;<br>
 &nbsp; &nbsp;return EXIT_FAILURE;<br>
 &nbsp; &nbsp;}<br>
<br>
 &nbsp;const &nbsp; &nbsp; unsigned int &nbsp; Dimension = 3;<br>
 &nbsp;typedef &nbsp; unsigned char &nbsp;InputPixelType;<br>
 &nbsp;typedef &nbsp; unsigned char &nbsp;OutputPixelType;<br>
<br>
 &nbsp;typedef itk::Image&lt; InputPixelType, &nbsp;Dimension &gt; &nbsp; InputImageType;<br>
 &nbsp;typedef itk::Image&lt; OutputPixelType, Dimension &gt; &nbsp; OutputImageType;<br>
<br>
 &nbsp;typedef itk::ImageFileReader&lt; InputImageType &nbsp;&gt; &nbsp;ReaderType;<br>
 &nbsp;typedef itk::ImageFileWriter&lt; OutputImageType &gt; &nbsp;WriterType;<br>
<br>
 &nbsp;ReaderType::Pointer reader = ReaderType::New();<br>
 &nbsp;WriterType::Pointer writer = WriterType::New();<br>
<br>
 &nbsp;reader-&gt;SetFileName( argv[1] );<br>
 &nbsp;writer-&gt;SetFileName( argv[2] );<br>
 &nbsp; &nbsp;typedef itk::Similarity3DTransform&lt; double &gt; &nbsp;TransformType;<br>
 &nbsp;TransformType::Pointer transform = TransformType::New();<br>
<br>
 &nbsp;typedef TransformType::ParametersType ParametersType;<br>
 &nbsp;ParametersType parameters;<br>
 &nbsp; double angleInDegrees = atof( argv[3] );<br>
&nbsp; &nbsp; double scale &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= atof( argv[4] );<br>
 &nbsp;  &nbsp;transform-&gt;SetScale(scale);<br>
 &nbsp;typedef itk::ResampleImageFilter&lt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InputImageType, OutputImageType &gt; &nbsp;FilterType;<br>
<br>
 &nbsp;FilterType::Pointer filter = FilterType::New();<br>
<br>
<br>
 &nbsp;typedef itk::LinearInterpolateImageFunction&lt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; InputImageType, double &gt; &nbsp;InterpolatorType;<br>
 &nbsp;InterpolatorType::Pointer interpolator = InterpolatorType::New();<br>
&nbsp; &nbsp;filter-&gt;SetInterpolator( interpolator );<br>
<br>
 &nbsp;filter-&gt;SetDefaultPixelValue( 0 );<br>
<br>
 &nbsp;reader-&gt;Update();<br>
 &nbsp;const InputImageType::SpacingType&amp;<br>
 &nbsp; &nbsp;spacing = reader-&gt;GetOutput()-&gt;GetSpacing();<br>
 &nbsp;const InputImageType::PointType&amp;<br>
 &nbsp; &nbsp;origin &nbsp;= reader-&gt;GetOutput()-&gt;GetOrigin();<br>
 &nbsp;InputImageType::SizeType size =<br>
 &nbsp; &nbsp; &nbsp;reader-&gt;GetOutput()-&gt;GetLargestPossibleRegion().GetSize();<br>
<br>
 &nbsp;filter-&gt;SetOutputOrigin( origin );<br>
 &nbsp;filter-&gt;SetOutputSpacing( spacing );<br>
 &nbsp;filter-&gt;SetSize( size );<br>
<br>
<br>
 &nbsp;filter-&gt;SetInput( reader-&gt;GetOutput() );<br>
 &nbsp;writer-&gt;SetInput( filter-&gt;GetOutput() );<br>
 &nbsp;TransformType::InputPointType rotationCenter;<br>
 &nbsp;rotationCenter[0] = origin[0] + spacing[0] * size[0] / 2.0;<br>
 &nbsp;rotationCenter[1] = origin[1] + spacing[1] * size[1] / 2.0;<br>
 &nbsp;rotationCenter[2] = origin[2] + spacing[2] * size[2] / 2.0;<br>
 &nbsp;transform-&gt;SetCenter( rotationCenter );<br>
<br>
 &nbsp;typedef TransformType::VersorType VersorType;<br>
 &nbsp;typedef VersorType::VectorType VectorType;<br>
 &nbsp;VersorType rotation;<br>
 &nbsp;VectorType axis;<br>
 &nbsp;axis[0]=0.0;<br>
 &nbsp;axis[1]=0.0;<br>
 &nbsp;axis[2]=1.0;<br>
 &nbsp; double degreesToRadians = atan(1.0) / 45.0;<br>
 &nbsp; &nbsp;const double angle = angleInDegrees * degreesToRadians;<br>
&nbsp;rotation.Set (axis, angle);<br>
 &nbsp;transform-&gt;SetRotation( rotation );<br>
&nbsp; &nbsp;TransformType::OutputVectorType translation;<br>
<br>
 &nbsp;translation[0] = &nbsp; 0.0;<br>
 &nbsp;translation[1] = &nbsp; 0.0;<br>
 &nbsp;translation[2] = &nbsp; 0.0;<br>
 &nbsp;transform-&gt;SetTranslation (translation);<br>
&nbsp;<br>
 &nbsp;filter-&gt;SetTransform( transform );<br>
<br>
 &nbsp;try<br>
 &nbsp; &nbsp;{<br>
 &nbsp; &nbsp;writer-&gt;Update();<br>
 &nbsp; &nbsp;}<br>
 &nbsp;catch( itk::ExceptionObject &amp; excep )<br>
 &nbsp; &nbsp;{<br>
 &nbsp; &nbsp;std::cerr &lt;&lt; &quot;Exception catched !&quot; &lt;&lt; std::endl;<br>
 &nbsp; &nbsp;std::cerr &lt;&lt; excep &lt;&lt; std::endl;<br>
 &nbsp; &nbsp;}<br>
 &nbsp;return EXIT_SUCCESS;<br>
}<br>
<br>
<br></div></div><div>
On Fri, Mar 28, 2008 at 6:18 PM, Luis Ibanez &lt;<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a> &lt;mailto:<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>&gt;&gt; wrote:<br>



<br>
 &nbsp; &nbsp;Hi Giorgos,<br>
<br>
 &nbsp; &nbsp;1) How different are the intensities of the output image ?<br>
<br>
 &nbsp; &nbsp;2) What Transform are you using ?<br>
<br>
 &nbsp; &nbsp;3) What interpolator are you using ?<br>
<br>
 &nbsp; &nbsp;4) What image type did you defined for the input ?<br>
<br>
 &nbsp; &nbsp;5) What image type did you defined for the output ?<br>
<br>
 &nbsp; &nbsp;6) What is the modality of the input image ?<br>
<br>
 &nbsp; &nbsp;...<br>
<br>
 &nbsp; &nbsp;7) Please post your code to the list.<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp;Thanks<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; Luis<br>
<br>
<br>
 &nbsp; &nbsp;-----------------------<br>
 &nbsp; &nbsp;Giorgos Pichis wrote:<br>
 &nbsp; &nbsp;&gt; Hi there,<br>
 &nbsp; &nbsp;&gt; I tried to resample a 3d image (.vtk) with a transformation,<br>
 &nbsp; &nbsp;&gt; but the output image ( &nbsp;writer-&gt;SetInput(filter-&gt;GetOutput() ); &nbsp; )<br>
 &nbsp; &nbsp;&gt; had different intensity values than the input image.<br>
 &nbsp; &nbsp;&gt; Do you know what might be the problem?<br>
 &nbsp; &nbsp;&gt; Thanks<br>
 &nbsp; &nbsp;&gt;<br>
 &nbsp; &nbsp;&gt;<br>
 &nbsp; &nbsp;&gt;<br>
 &nbsp; &nbsp;------------------------------------------------------------------------<br>
 &nbsp; &nbsp;&gt;<br>
 &nbsp; &nbsp;&gt; _______________________________________________<br>
 &nbsp; &nbsp;&gt; Insight-users mailing list<br></div>
 &nbsp; &nbsp;&gt; <a href="mailto:Insight-users@itk.org" target="_blank">Insight-users@itk.org</a> &lt;mailto:<a href="mailto:Insight-users@itk.org" target="_blank">Insight-users@itk.org</a>&gt;<div><br>
 &nbsp; &nbsp;&gt; <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br>
<br>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
Insight-users mailing list<br>
<a href="mailto:Insight-users@itk.org" target="_blank">Insight-users@itk.org</a><br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
 &nbsp;<br>
</div></blockquote>
<br>
</blockquote></div><br>
</div></div></blockquote></div><br>