[ITK] [ITK-users] ImageSeriesWriter | SimpleITK

Bradley Lowekamp blowekamp at mail.nih.gov
Tue Mar 24 14:12:47 EDT 2015


Hello,

On Mar 24, 2015, at 1:56 PM, Matias Montroull <matimontg at gmail.com> wrote:

> //Here's where I struggle...
>             vs.Add(path_pacientes + nombre_paciente + @"\Fusion\SalidaTest\imagen%03d.dcm"); //Is this rthe right way to include a vector of strings


No that is not the write way. You actually need to create the list for file names. You needs something closer to what's here in the C++ test [1] but converted to CSharp. The length of the list must match the z size of the images.

Many languages have convenient generator expressions or list comprehensions, which seems more natural than C printf formatting and the perils associated with it.

The long way to do it is just write a little for loop, something like:

for (i=0; i < img.GetSize()[2], ++i)
	vs.Add( "name {0}.ext".Format(i))

Brad

[1] https://github.com/SimpleITK/SimpleITK/blob/master/Testing/Unit/IOTests.cxx#L123-L152

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150324/181afae8/attachment.html>
-------------- next part --------------
_____________________________________
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://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://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list