MCPcopy Create free account
hub / github.com/MITK/MITK / GetWriterConfidenceLevel

Method GetWriterConfidenceLevel

Modules/Core/src/IO/mitkItkImageIO.cpp:746–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

744 }
745
746 AbstractFileIO::ConfidenceLevel ItkImageIO::GetWriterConfidenceLevel() const
747 {
748 // Check if the image dimension is supported
749 const auto *image = dynamic_cast<const Image *>(this->GetInput());
750 if (image == nullptr)
751 {
752 // We cannot write a null object, DUH!
753 return IFileWriter::Unsupported;
754 }
755
756 if (!m_ImageIO->SupportsDimension(image->GetDimension()))
757 {
758 // okay, dimension is not supported. We have to look at a special case:
759 // 3D-Image with one slice. We can treat that as a 2D image.
760 if ((image->GetDimension() == 3) && (image->GetSlicedGeometry()->GetSlices() == 1))
761 return IFileWriter::Supported;
762 else
763 return IFileWriter::Unsupported;
764 }
765
766 // Check if geometry information will be lost
767 if (image->GetDimension() == 2 && !image->GetGeometry()->Is2DConvertable())
768 {
769 return IFileWriter::PartiallySupported;
770 }
771 return IFileWriter::Supported;
772 }
773
774 ItkImageIO *ItkImageIO::IOClone() const { return new ItkImageIO(*this); }
775 void ItkImageIO::InitializeDefaultMetaDataKeys()

Callers

nothing calls this directly

Calls 6

SupportsDimensionMethod · 0.80
GetSlicedGeometryMethod · 0.80
Is2DConvertableMethod · 0.80
GetGeometryMethod · 0.80
GetInputMethod · 0.45
GetDimensionMethod · 0.45

Tested by

no test coverage detected