#include <vtkImageStencil.h>
#include <vtkLinearExtrusionFilter.h>
#include <vtkMetaImageWriter.h>
+#include <vtkXMLPolyDataWriter.h>
//--------------------------------------------------------------------
{
mROI = NULL;
mWriteOutput = false;
+ mWriteMesh = false;
mCropMask = true;
}
//--------------------------------------------------------------------
//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+void clitk::DicomRTStruct2ImageFilter::SetWriteMesh(bool b)
+{
+ mWriteMesh = b;
+}
+//--------------------------------------------------------------------
+
+
//--------------------------------------------------------------------
void clitk::DicomRTStruct2ImageFilter::SetOutputImageFilename(std::string s)
{
// Get Mesh
vtkPolyData * mesh = mROI->GetMesh();
+ if (mWriteMesh) {
+ vtkSmartPointer<vtkXMLPolyDataWriter> meshWriter = vtkSmartPointer<vtkXMLPolyDataWriter>::New();
+ std::string vtkName = mOutputFilename;
+ vtkName += ".vtk";
+ meshWriter->SetFileName(vtkName.c_str());
+#if VTK_MAJOR_VERSION <= 5
+ meshWriter->SetInput(mesh);
+#else
+ meshWriter->SetInputData(mesh);
+#endif
+ meshWriter->Write();
+ }
// Get bounds
double *bounds=mesh->GetBounds();
}
}
-std::cout << "origin " << origin[0] << " " << origin[1] << " " << origin[2] << std::endl;
-std::cout << "extend " << extend[0] << " " << extend[1] << " " << extend[2] << std::endl;
// Create new output image
mBinaryImage = vtkSmartPointer<vtkImageData>::New();
#if VTK_MAJOR_VERSION <= 5