[vtkusers] What is Data Type returned by vtkDataObject::GetDataObjectType method?

Grzegorz Toporek top.grzechu at gmail.com
Wed Dec 22 08:01:27 EST 2010


Dear all,

when I read DICOM files, ones via vtkDICOMImageReader (all DICOMs from
directory) and second time by using vtkDataSetReader (a .vtk file with the
same data, that has been read and saved with ITK) I got different Data Type
from vtkDataObject::GetDataObjectType method.

What does it mean that Data Type is 1 or 6? How can I change one Data Type
into another? The problem is, my volume is not rendering correctly for Data
Type 6 (vtkDICOMImageReader).

I use following code to get information about my data:

public void getImageDataInformation(vtkImageData object){
        //show information about data
        dataType = object.GetDataObjectType();
        String scalarType = object.GetScalarTypeAsString();
        //vtkInformation outInfo = new vtkInformation();
        // if 1 - grayscale if 3 RGB, HSV, HSI etc
        numberOfScalarComponents    = object.GetNumberOfScalarComponents();
        dim                         = object.GetDimensions();
        scalarTypeMax               = object.GetScalarTypeMax();
        scalarTypeMin               = object.GetScalarTypeMin();
        spacing                     = object.GetSpacing();
        dataRange                   = object.GetScalarRange();

        StringBuffer buffer = new StringBuffer();
        buffer.append("Number of components :
").append(numberOfScalarComponents);
        buffer.append("\n");
        buffer.append("Data dimentions:
").append(dim[0]).append("x").append(dim[1]).append("x").append(dim[2]);
        buffer.append("\n");
        buffer.append("Data type : ").append(dataType);
        buffer.append("\n");
        buffer.append("Data spacing :
").append(spacing[0]).append(spacing[1]).append(spacing[2]);
        buffer.append("\n");
        buffer.append("Scalar type: ").append(scalarType);
        buffer.append("\n");
        buffer.append("Data sclar min : ").append(scalarTypeMin).append("
and max: ").append(scalarTypeMax);
        buffer.append("\n");
        buffer.append("Image range:
").append(dataRange[0]).append("-").append(dataRange[1]);
        buffer.append("\n");

        if (debug){
            log.append(buffer.toString());
            log.setCaretPosition(log.getDocument().getLength());
            System.out.println(buffer.toString());
        }
    }

The output is:

1) for DICOMs

Number of components : 1
Data dimentions: 512x512x220
Data type : 6
Data spacing : 0.3906250.3906251.0
Scalar type: unsigned short
Data sclar min : 0.0 and max: 65535.0
Image range: 0.0-65535.0

2) for .vtk file

Number of components : 1
Data dimentions: 512x512x220
Data type : 1
Data spacing : 0.3906250.3906251.0
Scalar type: unsigned short
Data sclar min : 0.0 and max: 65535.0
Image range: 0.0-65535.0

Could you please give me some feedbacks?


Regards,
Grzegorz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101222/ea291ae4/attachment.htm>


More information about the vtkusers mailing list