<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div><div><div>Hi Brad, </div></div></div><span id="OLK_SRC_BODY_SECTION"><div><div style="font-size:14px; word-wrap:break-word"><div><div><div style="color:rgb(0,0,0); font-family:Calibri,sans-serif"><br></div><div style="color:rgb(0,0,0); font-family:Calibri,sans-serif">I'm running into this issue today with an fMRI dataset (3D + time) that I've preprocessed with AFNI and I want to register it with a label image and get out vectors for each 3D set in the time series.
I'd like to have this type of behavior:</div><div style="color:rgb(0,0,0); font-family:Calibri,sans-serif"><br></div><div style="color:rgb(0,0,0); font-family:Calibri,sans-serif"><span class="Apple-style-span" style="color: rgb(94, 94, 95); font-family: 'Lucida Console'; ">>>> from SimpleITK import *</span></div><div style="color:rgb(0,0,0); font-family:Calibri,sans-serif"><font class="Apple-style-span" face="Lucida Console" color="#5e5e5f">>>> label = ReadImage(label_file)</font></div><div style="color:rgb(0,0,0); font-family:Calibri,sans-serif"><font class="Apple-style-span" face="Lucida Console" color="#5e5e5f">>>> image = ReadImage(fMRI_file)</font></div><div style="color:rgb(0,0,0); font-family:Calibri,sans-serif"><font class="Apple-style-span" face="Lucida Console"><font class="Apple-style-span" color="#5e5e5f">>>> stats = LabelStatistics(label, image)</font><font class="Apple-style-span" color="#919191"># TODO: Docstring should specify that label comes first!</font></font></div><div><font class="Apple-style-span" color="#5e5e5f" face="Lucida Console">>>> for labelCode in stats.GetValidLabels():</font></div><div><font class="Apple-style-span" color="#5e5e5f" face="Lucida Console">>>> print stats.GetSum(labelCode)</font></div><div><font class="Apple-style-span" color="#5e5e5f" face="Lucida Console">[10, 30, 20, 15, …]</font></div><div><font class="Apple-style-span" color="#5e5e5f" face="Lucida Console">[15, 25, 20, 10, …]</font></div><div><font class="Apple-style-span" color="#5e5e5f" face="Lucida Console">Etc.</font></div><div><font class="Apple-style-span" color="#919191" face="Lucida Console"><br></font></div><div style="color:rgb(0,0,0); font-family:Calibri,sans-serif">Is there a bug report/ticket for 4D support in SimpleITK? What needs to be changed to extend LabelStatistics to handle 4D images?</div><div style="color:rgb(0,0,0); font-family:Calibri,sans-serif"><br></div><div style="color:rgb(0,0,0); font-family:Calibri,sans-serif"><div><div class="PlainText" style="color:rgb(0,0,0); font-family:Tahoma; font-size:13px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px">
Cheers, </div><div class="PlainText" style="color:rgb(0,0,0); font-family:Tahoma; font-size:13px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px">
David Welch, M.S.<br><br></div><div class="PlainText" style="color:rgb(0,0,0); font-family:Tahoma; font-size:13px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px"><hr></div><div class="PlainText" style="color:rgb(0,0,0); font-family:Tahoma; font-size:13px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px">
Applications Developer</div><div class="PlainText" style="color:rgb(0,0,0); font-family:Tahoma; font-size:13px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px">
Department of Psychiatry<br>
University of Iowa<br>
(319)384-9413<br><a href="mailto:dmwelch@healthcare.uiowa.edu">dmwelch@healthcare.iowa.edu</a></div><div class="PlainText" style="color:rgb(0,0,0); font-family:Tahoma; font-size:13px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px"><a href="mailto:david-welch@uiowa.edu">david-welch@iowa.edu</a></div></div><div class="PlainText" style="color:rgb(0,0,0); font-family:Tahoma; font-size:13px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:2; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px"><br></div></div></div></div><div style="color:rgb(0,0,0); font-family:Calibri,sans-serif"><br></div><span id="OLK_SRC_BODY_SECTION" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; "><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>Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br><span style="font-weight:bold">Date: </span>Mon, 23 Apr 2012 11:00:26 -0400<br><span style="font-weight:bold">To: </span>Mathieu Stumpf <<a href="mailto:mathieu.stumpf@etu.unistra.fr">mathieu.stumpf@etu.unistra.fr</a>><br><span style="font-weight:bold">Cc: </span>"<a href="mailto:insight-users@itk.org">insight-users@itk.org</a>" <<a href="mailto:insight-users@itk.org">insight-users@itk.org</a>><br><span style="font-weight:bold">Subject: </span>Re: [Insight-users] ITK to VTK for 4D images<br></div><div><br></div><div><div style="word-wrap:break-word">Hello,
<div><br></div><div>What is the current issue you are having with your SimpleITK implementation?</div><div><br></div><div>Currently, I am aware what we don't have support to convert VectorImage to numpy arrays. But that is near the top of my todo list this week. </div><div><br></div><div>Also, I am interested in your input data? What do you mean by 4D? 3D + time? 3D+ multichannel? What is your input file format and what is the meta data that is report? If there is an issue with SimpleITK reading it, I'd like to see a sample file to see
if support could easily be added.</div><div><br></div><div>Brad</div><div><br><div><div>On Apr 23, 2012, at 8:22 AM, Mathieu Stumpf wrote:</div><br>
...<br><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><br></font>Well, it provide a vtkImageData (I checked with a print), but using it<br>
instead of my previous solution using SimpleITK make my application<br>
crash, without any debugging information. The previous working solution<br>being :<br><br>
self.sitk_image = sitk.ReadImage(str(file_path) )<br>
self.numpy_img = sitk.GetArrayFromImage( self.sitk_image ) <br>
n2vtk = vtkImageImportFromArray() # Converter<br>
n2vtk.SetArray(self.numpy_img)<br>
n2vtk.Update()<br>
self.vtk_image = n2vtk.GetOutput()<br><br>
I welcome any suggestion<br>
kind regards,<br>
mathieu<br><br><br><br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>
Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">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.php">http://www.kitware.com/products/protraining.php</a><br><br>
Please keep messages on-topic and check the ITK FAQ at:<br><a href="http://www.itk.org/Wiki/ITK_FAQ">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">http://www.itk.org/mailman/listinfo/insight-users</a><br></div></blockquote></div><br><div><div style="word-wrap:break-word; font-family:Helvetica; font-size:12px"><span class="Apple-style-span" style="border-collapse:separate; color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; text-indent:0px; text-transform:none; orphans:2; white-space:normal; widows:2; word-spacing:0px"><p style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px"><font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">========================================================</font></p><p style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px"><font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">Bradley Lowekamp<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span></font></p><p style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px"><font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">Medical Science and Computing for</font></p><p style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px"><font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">Office of High Performance Computing and Communications</font></p><p style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px"><font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">National Library of Medicine<span class="Apple-converted-space"> </span></font></p><p style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px"><font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica"><a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a></font></p><br class="Apple-interchange-newline"></span></div><br class="Apple-interchange-newline"></div><br></div></div></div></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></div></div></span></body></html>