0
votes

That's it:

I read successfully a DICOM file with itk::ImageFileReader.

Now I want to export an image.

I use vtkJPEGWriter.

When I add the line

    vtkJPEGWriter* writer = vtkJPEGWriter::New();

even if that code doesn't run at the beginning of execution... I can't read the file. I comment the line, then I read the file again.

But the writer is not connected with the file reader. I don't get it. It has nothing to do at that moment!!

I'm wasting so much time, just trying to figure out what's the problem.

2

2 Answers

0
votes

The problem is in the file. I don't know why it works with that file without that line. Really weird.

I just don't get it.

I will try with other files.

0
votes

These lines are worked for me:

vtkSmartPointer<vtkJPEGWriter> JPEGWriter = vtkSmartPointer<vtkJPEGWriter>::New();
JPEGWriter->SetFileName("d:\\Tempx\\Pacienttest3\\Sagital.bmp");
JPEGWriter->SetInputConnection(m_pColor->GetOutputPort());
JPEGWriter->Write();

where m_pColor is kind of vtkImageMapToColors type ...