[vtk-developers] Convert a bmp files to DICOM series file

toulgen toulgen at gmail.com
Thu Apr 30 04:17:10 EDT 2009


 

Hello,

 

I am currently trying to convert a bmp files (img1.bmp, img2.bmp, img3.bmp,
.) to DICOM series file.

I use this method to read a DICOM series:

----------------------------------------------------------------------------
----------------------------------------------------------------------------
--------

public void readVTKDicom(string dirname)

        {

            vtk.vtkDICOMImageReader DICOMreader = new
vtk.vtkDICOMImageReader();

            DICOMreader.SetDirectoryName(dirname);

            DICOMreader.SetDataOrigin(0, 0, 0);

            DICOMreader.Update();

 

            vtk.vtkImageChangeInformation imageChangeInformation = new
vtk.vtkImageChangeInformation();

            imageChangeInformation.SetInput(DICOMreader.GetOutput());

            imageChangeInformation.CenterImageOn(); // Centered the image
here....

            imageChangeInformation.Update();

 

            VoxelData = imageChangeInformation.GetOutput();

 

            spacing = VoxelData.GetSpacing();

            int numberofpixels = VoxelData.GetNumberOfPoints();

            dimensions = VoxelData.GetDimensions();

            metaScalarRange = VoxelData.GetScalarRange();

            double[] origin = VoxelData.GetOrigin();

       

            GC.Collect();

        }

----------------------------------------------------------------------------
----------------------------------------------------------------------------
--------

 

I need a help for converting bmp images to DICOM series file?

 

Thx

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20090430/80fa57b5/attachment.html>


More information about the vtk-developers mailing list