<font size="2"><font face="verdana,sans-serif">I never used python. I cannot help you there :(<br></font></font><br><div class="gmail_quote">On Mon, Jun 27, 2011 at 18:32, Oscar Esteban <span dir="ltr"><<a href="mailto:oesteban@die.upm.es">oesteban@die.upm.es</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi <span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">Dženan,</span><div><font face="arial, sans-serif"><span style="border-collapse:collapse"><br>
</span></font></div><div><font face="arial, sans-serif"><span style="border-collapse:collapse">Thank you very much for your answer, I will try it as 4D image. Probably it will work :)</span></font></div>
<div><font face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font></div><div><font face="arial, sans-serif"><span style="border-collapse:collapse">The problem is that I selected the component vector because I didn't find a way to add a new timestep to a 4D image in ITK-Python :( . Any clue?</span></font></div>
<div><font face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font></div><div><font face="arial, sans-serif"><span style="border-collapse:collapse">Bests, and thank you all again :)</span></font></div>
<div><font face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font></div><font color="#888888"><div><font face="arial, sans-serif"><span style="border-collapse:collapse">Oscar Esteban</span></font></div>
<div><font face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font></div><div><font face="arial, sans-serif"><span style="border-collapse:collapse"><br>
</span></font></div></font><div><div class="im"><div><div><b>______________________________________</b></div><div><b>Oscar Esteban</b></div><div>PhD Student / Researcher</div><div>Biomedical Image Technologies (Universidad Politécnica de Madrid)</div>
<div><br></div><div><font color="#999999">ETSI Telecomunicación (Lab. C203)</font></div><div><font color="#999999">Av. Complutense s/n - E-28040 Madrid (Spain)</font></div><div><span style="color:rgb(153, 153, 153)"><a href="tel:%2B34%20915%20495%20700%20ext.4234" value="+34915495700" target="_blank">+34 915 495 700 ext.4234</a></span></div>
</div><br>
<br><br></div><div><div></div><div class="h5"><div class="gmail_quote">On 27 June 2011 09:43, Dženan Zukić <span dir="ltr"><<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<font size="2"><font face="verdana,sans-serif">Well your file was written as a 4D image, the vector components being the 4th dimension.<br></font></font><div><font face="verdana, sans-serif"><br></font></div>
<div><font face="verdana, sans-serif">It should not be hard to convert the 4th dimension to 62-component vectors in 3D image. I do not have any code excerpts which would help you though.<br></font></div>
<div><div class="gmail_quote"><br></div><div class="gmail_quote">HTH,</div><div class="gmail_quote">Dženan</div><div><div></div><div><div class="gmail_quote"><br></div><div class="gmail_quote">On Mon, Jun 27, 2011 at 09:18, Oscar Esteban <span dir="ltr"><<a href="mailto:oesteban@die.upm.es" target="_blank">oesteban@die.upm.es</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font face="arial, sans-serif"><span style="border-collapse:collapse">Hi Gaëtan,</span></font><div style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">
<br></div><div style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">"print r" gives me the next output:</div><div style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">
<br></div><div><blockquote class="gmail_quote" style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<C itk::SmartPointer<(itk::ImageFileReader<(itk::VectorImage<(unsigned short,3u)>,itk::DefaultConvertPixelTraits<(unsigned short)>)>)> instance at _8058f60600000000_p_itk__SmartPointerTitk__ImageFileReaderTitk__VectorImageTunsigned_short_3u_t_itk__DefaultConvertPixelTraitsTunsigned_short_t_t_t></blockquote>
<div style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px"><br></div><div style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px"> These are the headers:</div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<font face="arial, sans-serif"><span style="border-collapse:collapse">$ mri_info DTI.nii.gz <br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse">Volume information for DTI.nii.gz<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> type: nii<br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> dimensions: 128 x 128 x 44 x 62<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> voxel sizes: 2.0000, 2.0000, 3.0000<br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> type: FLOAT (3)<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> fov: 256.000<br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> dof: 0<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> xstart: -128.0, xend: -128.0<br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> ystart: -128.0, yend: -128.0<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> zstart: -66.0, zend: -66.0<br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> TR: 5043.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> nframes: 62<br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> PhEncDir: UNKNOWN<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse">ras xform present<br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 6.7797<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> : x_a = 0.0000, y_a = 1.0000, z_a = 0.0000, c_a = 50.8135<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> : x_s = 0.0000, y_s = 0.0000, z_s = 1.0000, c_s = 21.9552<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse">Orientation : LAS<br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse">Primary Slice Direction: axial<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse">voxel to ras transform:<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> -2.0000 0.0000 0.0000 134.7797<br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> 0.0000 2.0000 0.0000 -77.1865<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> 0.0000 0.0000 3.0000 -44.0448<br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> 0.0000 0.0000 0.0000 1.0000<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse">voxel-to-ras determinant -12<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse">ras to voxel transform:<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> -0.5000 0.0000 0.0000 67.3898<br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> -0.0000 0.5000 -0.0000 38.5932<br>
</span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> -0.0000 -0.0000 0.3333 14.6816<br></span></font><font face="arial, sans-serif"><span style="border-collapse:collapse"> 0.0000 0.0000 0.0000 1.0000</span></font></blockquote>
<div><br></div><div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
$ mri_info test.nii.gz <br>Volume information for test.nii.gz<br> type: nii<br> dimensions: 128 x 128 x 44<br> voxel sizes: 2.0000, 2.0000, 3.0000<br> type: FLOAT (3)<br> fov: 256.000<br>
dof: 0<br>
xstart: -128.0, xend: -128.0<br> ystart: -128.0, yend: -128.0<br> zstart: -66.0, zend: -66.0<br> TR: 0.00 msec, TE: 0.00 msec, TI: 0.00 msec, flip angle: 0.00 degrees<br> nframes: 1<br>
PhEncDir: UNKNOWN<br>ras xform present<br> xform info: x_r = -1.0000, y_r = 0.0000, z_r = 0.0000, c_r = 6.7797<br> : x_a = 0.0000, y_a = -1.0000, z_a = 0.0000, c_a = -205.1865<br> : x_s = 0.0000, y_s = 0.0000, z_s = 1.0000, c_s = 21.9552<br>
Orientation : LPS<br>Primary Slice Direction: axial<br>voxel to ras transform:<br> -2.0000 0.0000 0.0000 134.7797<br> 0.0000 -2.0000 0.0000 -77.1865<br> 0.0000 0.0000 3.0000 -44.0448<br>
0.0000 0.0000 0.0000 1.0000<br>voxel-to-ras determinant 12<br>ras to voxel transform:<br> -0.5000 0.0000 0.0000 67.3898<br> 0.0000 -0.5000 0.0000 -38.5932<br>
-0.0000 -0.0000 0.3333 14.6816<br> 0.0000 0.0000 0.0000 1.0000</blockquote></div><div><br></div><div>I'm sorry about the delay, but the list rejected previous emails containing image captures.</div>
<div><br></div><div>Thanks. Best Regards,</div><div><br></div><div><br></div><div><br></div><div><b>______________________________________</b></div></div><div><div><div><b>Oscar Esteban</b></div><div>PhD Student / Researcher</div>
<div>Biomedical Image Technologies (Universidad Politécnica de Madrid)</div><div><br></div><div><font color="#999999">ETSI Telecomunicación (Lab. C203)</font></div><div><font color="#999999">Av. Complutense s/n - E-28040 Madrid (Spain)</font></div>
<div><span style="color:rgb(153, 153, 153)"><a href="tel:%2B34%20915%20495%20700%20ext.4234" value="+34915495700" target="_blank">+34 915 495 700 ext.4234</a></span></div></div><br>
<br><br></div><div><div></div><div><div class="gmail_quote">2011/6/21 Gaëtan Lehmann <span dir="ltr"><<a href="mailto:gaetan.lehmann@jouy.inra.fr" target="_blank">gaetan.lehmann@jouy.inra.fr</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hi,<br>
<br>
Le 21 juin 11 à 17:52, Oscar Esteban a écrit :<div><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
I'm trying to load a 62 component vector image with itk using the Python wrapping. I executed this:<br>
<br>
1: import itk<br>
2: r = itk.ImageFileReader.VIUS3.New( FileName='DTI.nii.gz' )<br>
</blockquote>
<br></div>
can you run<br>
<br>
r.Update()<br>
print r<br>
<br>
at this point, and give us the result?<div><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
3: im = r.GetOutput()<br>
4: im.SetVectorLength(62)<br>
5: w = itk.ImageFileWriter.VIUS3.New( im, FileName='test.nii.gz' )<br>
6: w.Update()<br>
<br>
I also tried with im.SetNumberOfPixelCompoents( 62 )<br>
<br>
But test.nii.gz only contains 1 component (and, I think it is written as if it were a 62-component file).<br>
<br>
</blockquote>
<br></div>
can you show us the header of that file, or even better, the actual file?<div><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How should I configure the FileReader to get the 62 components?<br>
</blockquote>
<br></div>
It should read the image with the right number of components...<br>
<br>
Regards,<br>
<br>
Gaëtan<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
How should I add new components?<br>
<br>
thanks. Best Regards,<br>
<br>
Oscar Esteban<br>
<br>
<br>
______________________________<u></u>________<br>
Oscar Esteban<br>
PhD Student / Researcher<br>
Biomedical Image Technologies (Universidad Politécnica de Madrid)<br>
<br>
ETSI Telecomunicación (Lab. C203)<br>
Av. Complutense s/n - E-28040 Madrid (Spain)<br>
<a href="tel:%2B34%20915%20495%20700%20ext.4234" value="+34915495700" target="_blank">+34 915 495 700 ext.4234</a><br>
<a href="tel:%2B34%20659%20639%20123" value="+34659639123" target="_blank">+34 659 639 123</a><br>
<br></div>
______________________________<u></u>_______<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<u></u>opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/<u></u>products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_<u></u>FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/<u></u>listinfo/insight-users</a><br>
</blockquote>
<br>
-- <br>
Gaëtan Lehmann<br>
Biologie du Développement et de la Reproduction<br>
INRA de Jouy-en-Josas (France)<br>
tel: <a href="tel:%2B33%201%2034%2065%2029%2066" value="+33134652966" target="_blank">+33 1 34 65 29 66</a> fax: 01 34 65 29 09<br>
<a href="http://mima2.jouy.inra.fr" target="_blank">http://mima2.jouy.inra.fr</a> <a href="http://www.itk.org" target="_blank">http://www.itk.org</a><br>
<a href="http://www.bepo.fr" target="_blank">http://www.bepo.fr</a><br>
<br>
</blockquote></div><br>
</div></div><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>