#include "stdafx.h"
#include "vtkDICOMImageReader.h"
#include "vtkImageCast.h"
#include "vtkMetaImageWriter.h"
#include "vtkStructuredPointsWriter.h"
#include "vtkCylinder.h"
#include "vtkClipVolume.h"
#include "vtkTransform.h"
int main()
{
vtkDICOMImageReader *reader = vtkDICOMImageReader::New();
reader->SetDataByteOrderToLittleEndian();
reader->SetDirectoryName("dirpath");
vtkImageCast *readerImageCast = vtkImageCast::New();
readerImageCast->SetInputConnection(reader->GetOutputPort());
readerImageCast->SetOutputScalarTypeToUnsignedChar();
readerImageCast->ClampOverflowOn();
vtkMetaImageWriter *pvTemp200 = vtkMetaImageWriter::New();
pvTemp200->SetInputConnection(readerImageCast->GetOutputPort());
pvTemp200->SetCompression(0);
pvTemp200->SetFileName("filename.mhd");
pvTemp200->Write();
pvTemp200->Delete();
reader->Delete();
readerImageCast->Delete();
return 0;
}
#include "vtkDICOMImageReader.h"
#include "vtkImageCast.h"
#include "vtkMetaImageWriter.h"
#include "vtkStructuredPointsWriter.h"
#include "vtkCylinder.h"
#include "vtkClipVolume.h"
#include "vtkTransform.h"
int main()
{
vtkDICOMImageReader *reader = vtkDICOMImageReader::New();
reader->SetDataByteOrderToLittleEndian();
reader->SetDirectoryName("dirpath");
vtkImageCast *readerImageCast = vtkImageCast::New();
readerImageCast->SetInputConnection(reader->GetOutputPort());
readerImageCast->SetOutputScalarTypeToUnsignedChar();
readerImageCast->ClampOverflowOn();
vtkMetaImageWriter *pvTemp200 = vtkMetaImageWriter::New();
pvTemp200->SetInputConnection(readerImageCast->GetOutputPort());
pvTemp200->SetCompression(0);
pvTemp200->SetFileName("filename.mhd");
pvTemp200->Write();
pvTemp200->Delete();
reader->Delete();
readerImageCast->Delete();
return 0;
}