[Insight-users] DICOM Image series reading - using .NET

Dan Mueller dan.muel at gmail.com
Wed Sep 5 02:31:05 EDT 2007


Hi Subbu,

I'm not quite sure I understand your question... Do you mean: how do I
read a 3-D image from a series of 2-D images using ManagedITK?

If you mean the above then use the following C# code (make sure you
add ManagedITK.Common.dll and ManagedITK.IO.dll as references to your
project):

    // Read series
    String[] filenames = new String[]{"file1.png","file2.png","file3.png"};
    itk.itkImageSeriesReader_IUC3 reader = itk.itkImageSeriesReader_IUC3.New();
    reader.SetFileNames(filenames);
    reader.Update();

    // Get resultant image
    itk.itkImage_UC3 image = itk.itkImage_UC3.New();
    reader.GetOutput(image);

    // Write image
    itk.itkImageFileWriter_IUC3 writer = itk.itkImageFileWriter_IUC3.New();
    writer.SetInput(image);
    writer.FileName = "output.mhd";
    writer.Update();

If you mean something else, can you please clarify?

Cheers, Dan

On 05/09/07, Subbu <subbu.iitb at gmail.com> wrote:
>
> Hi,
>
> does anyone know how to read a series of images using managed ITK for
> creating 3D model of it.
>
>
> Regards . Subbu
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list