MCPcopy Create free account
hub / github.com/SimVascular/SimVascular / WriteImage

Function WriteImage

Code/Source/PythonAPI/ImagingImage_PyClass.cxx:344–356  ·  view source on GitHub ↗

------------ WriteImage ------------ Write the image to a VTK .vti file.

Source from the content-addressed store, hash-verified

342// Write the image to a VTK .vti file.
343//
344void WriteImage(PyImage* self, const std::string& fileName)
345{
346 vtkImageData* vtkImg = sv4guiVtkUtils::MitkImage2VtkImage(self->image_data);
347
348 if (vtkImg == nullptr) {
349 throw std::runtime_error("Unable to get VTK image data.");
350 }
351
352 vtkSmartPointer<vtkXMLImageDataWriter> writer = vtkSmartPointer<vtkXMLImageDataWriter>::New();
353 writer->SetFileName(fileName.c_str());
354 writer->SetInputData(vtkImg);
355 writer->Write();
356}
357
358//---------------------
359// WriteImageTransform

Callers 1

Image_writeFunction · 0.70

Calls 4

MitkImage2VtkImageFunction · 0.85
c_strMethod · 0.80
SetInputDataMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected