[vtkusers] DICOM pixel value is strange
arwtyxouymz
arw.tyx-ouy_mz at ezweb.ne.jp
Fri Oct 20 03:06:26 EDT 2017
Hi,
I wrote the code to pick the DICOM pixel value, but pixel value is strange.
My code is below:
```
vtkSmartPointer<vtkImageData> image = reader->GetOutput();
int ijk[3];
double pcoords[3];
for (vtkIdType id = 0; id < image->GetNumberOfPoints(); ++id) {
int check = image->ComputeStructuredCoordinates(image->GetPoint(id),
ijk, pcoords);
cout << "ID: " << id << ", ";
cout << "ijk: " << "(" << ijk[0] << ", " << ijk[1] << ", " << ijk[2]
<< "), ";
auto *pixel = static_cast<double*>(image->GetScalarPointer(ijk));
cout << "Pixel: " << *pixel << endl;
}
```
I supposed *pixel value is in the range 0 ~ 255, but actual output is like
-2.06898e+289.
Why?
Moreover, *pixel max value is 1.98914e-289, and sometimes *pixel is nan.
It's strange!!!
Can you help me?
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
More information about the vtkusers
mailing list