[vtkusers] vtkDICOMImageReader and vtkImageShiftScale
Alex Duţu
alex.dutu at gmail.com
Wed Jun 24 09:14:20 EDT 2009
Thank you Francois,
I have one more problem at scale->SetInputConnection or scale->SetInput. My
code looks like this:
vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New();
dicomReader->SetDirectoryName("D:/MANIX/CER-CT/AVEC I.V");
dicomReader->SetDataScalarTypeToUnsignedShort();
dicomReader->UpdateWholeExtent();
double range[1];
dicomReader->GetOutput()->GetPointData()->GetScalars()->GetRange(range);
//I could have used
//dicomReader->GetOutput()->GetScalarRange(range);
vtkImageShiftScale *scale = vtkImageShiftScale::New();
scale->SetInputConnection(dicomReader->GetOutputPort());
//scale->SetInput(dicomReader->GetOutput());
scale->SetShift(-range[0]);
scale->SetScale(VTK_UNSIGNED_SHORT_MAX/(range[1]-range[0]));
scale->SetOutputScalarTypeToUnsignedShort();
scale->Update();
I got this error:
Unhandled exception at 0x00594c21 in RayCast.exe: 0xC0000005: Access
violation reading location 0x40a7fc34.
at
int vtkAlgorithm::GetNumberOfOutputPorts()
{
return this->OutputPortInformation->GetNumberOfInformationObjects();
}
and if I used scale->SetInput(dicomReader->GetOutput()); I got:
Unhandled exception at 0x0058dae3 in RayCast.exe: 0xC0000005: Access
violation reading location 0x40a7fc2c.
at
int vtkAlgorithm::HasExecutive()
{
return this->Executive ? 1 : 0;
}
Any thoughts?
Thanks,
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090624/5f46f6e8/attachment.htm>
More information about the vtkusers
mailing list