[Insight-users] Re ITK to VTK for 4D images

David M. Welch david.m.welch at gmail.com
Wed Nov 28 14:32:39 EST 2012


Hi Brad, 

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:

>>> from SimpleITK import *
>>> label = ReadImage(label_file)
>>> image = ReadImage(fMRI_file)
>>> stats = LabelStatistics(label, image)# TODO: Docstring should specify that
label comes first!
>>> for labelCode in stats.GetValidLabels():
>>>    print stats.GetSum(labelCode)
[10, 30, 20, 15, Š]
[15, 25, 20, 10, Š]
Etc.

Is there a bug report/ticket for 4D support in SimpleITK?  What needs to be
changed to extend LabelStatistics to handle 4D images?

Cheers, 
David Welch, M.S.


Applications Developer
Department of Psychiatry
University of Iowa
(319)384-9413
dmwelch at healthcare.iowa.edu <mailto:dmwelch at healthcare.uiowa.edu>
david-welch at iowa.edu <mailto:david-welch at uiowa.edu>


From: Bradley Lowekamp <blowekamp at mail.nih.gov>
Date: Mon, 23 Apr 2012 11:00:26 -0400
To: Mathieu Stumpf <mathieu.stumpf at etu.unistra.fr>
Cc: "insight-users at itk.org" <insight-users at itk.org>
Subject: Re: [Insight-users] ITK to VTK for 4D images

Hello, 

What is the current issue you are having with your SimpleITK implementation?

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.

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.

Brad

On Apr 23, 2012, at 8:22 AM, Mathieu Stumpf wrote:

...
> 
> Well, it provide a vtkImageData (I checked with a print), but using it
> instead of my previous solution using SimpleITK make my application
> crash, without any debugging information. The previous working solution
> being :
> 
>        self.sitk_image = sitk.ReadImage(str(file_path) )
>        self.numpy_img = sitk.GetArrayFromImage( self.sitk_image )
>        n2vtk = vtkImageImportFromArray() # Converter
>        n2vtk.SetArray(self.numpy_img)
>        n2vtk.Update()
>        self.vtk_image = n2vtk.GetOutput()
> 
> I welcome any suggestion
> kind regards,
> mathieu
> 
> 
> 
> _____________________________________
> Powered by www.kitware.com <http://www.kitware.com>
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users

========================================================

Bradley Lowekamp  

Medical Science and Computing for

Office of High Performance Computing and Communications

National Library of Medicine

blowekamp at mail.nih.gov






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. 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20121128/943978a9/attachment.htm>


More information about the Insight-users mailing list