[Insight-users] [Insight-developers] Tool for converting 2D images to 3D volume
Bradley Lowekamp
blowekamp at mail.nih.gov
Fri Jan 11 10:10:05 EST 2013
Hello,
If you feel like passing your arguments in a scripting language as opposed to the command line then SimpleITK would be an excellent chose for this.
There are pre-compiled built distributions for Python, Java and C#, while if R, Tcl, or ruby is preferred you will need to compile from source. More information can be found on the wiki about getting started:
http://www.itk.org/Wiki/ITK_Release_4/SimpleITK/GettingStarted
I don't specifically know what you need to do, but it likely can just be done in a couple lines of Python. I don't have an example to point you too, but as this is a common task, I could do that if it would be helpful.
Briefly something like this should work:
fnames = glob.glob("my*.ext")
img = sitk.ReadImage(fnames)
img.SetSpacing( [1,2,3] )
sitk.WriteImage( "out.mha", img )
Brad
On Jan 11, 2013, at 2:51 AM, Kulplex <kulplex at gmail.com> wrote:
> Hello everyone,
>
> I have been searching quite a bit and now I realized I should seek some support.
> My goal is to find a tool for converting 2D images (tiff, jpg or else) to a 3D volume (VTK supported format). I found quite some threads and also a guy posting what seemed to be exactly what I was looking for https://sites.google.com/site/pierrefillard/coding-blog/createa3dvolumefromseveral2dimages. In fact, I was amazed and extremely happy; sadly, the SVN URL provided on the website doesn't work, for whatever reason.
> So now I am back from the start.
>
> I was wondering if someone of you had, or knew where to find, a program (console) that either gets a list of images or the folder they are in and creates a 3D volume out of it. The program presented in the link above was actually really cool, for the fact that it could also convert 3D images to 4D ones.
>
> Regards,
>
> N.
> _______________________________________________
> Powered by 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://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-developers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130111/13b2be87/attachment-0001.htm>
More information about the Insight-users
mailing list