| 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() |
nothing calls this directly
no test coverage detected