Thank you Francois,<br><br>I have one more problem at scale->SetInputConnection or scale->SetInput. My code looks like this:<br><br>Â Â Â vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New();<br>Â Â Â dicomReader->SetDirectoryName("D:/MANIX/CER-CT/AVEC I.V");<br>
   dicomReader->SetDataScalarTypeToUnsignedShort();<br>   dicomReader->UpdateWholeExtent();<br>   double range[1];<br>   dicomReader->GetOutput()->GetPointData()->GetScalars()->GetRange(range);<br>   //I could have used <br>
   //dicomReader->GetOutput()->GetScalarRange(range);<br><br>   vtkImageShiftScale *scale = vtkImageShiftScale::New();<br>   scale->SetInputConnection(dicomReader->GetOutputPort());<br>   //scale->SetInput(dicomReader->GetOutput());<br>
   scale->SetShift(-range[0]);<br>   scale->SetScale(VTK_UNSIGNED_SHORT_MAX/(range[1]-range[0]));<br>   scale->SetOutputScalarTypeToUnsignedShort();<br>   scale->Update();<br><br>I got this error:<br><br>Unhandled exception at 0x00594c21 in RayCast.exe: 0xC0000005: Access violation reading location 0x40a7fc34.<br>
<br>at <br><br>int vtkAlgorithm::GetNumberOfOutputPorts()<br>{<br>Â return this->OutputPortInformation->GetNumberOfInformationObjects();<br>}<br><br>and if I used scale->SetInput(dicomReader->GetOutput()); I got:<br>
<br>Unhandled exception at 0x0058dae3 in RayCast.exe: 0xC0000005: Access violation reading location 0x40a7fc2c.<br><br>at <br><br>int vtkAlgorithm::HasExecutive()<br>{<br>Â return this->Executive ? 1 : 0;<br>}<br><br>Any thoughts?<br>
<br>Thanks,<br>Alex<br>