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

Method Write

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

Source from the content-addressed store, hash-verified

707 }
708
709 void ItkImageIO::Write()
710 {
711 const auto *image = dynamic_cast<const mitk::Image *>(this->GetInput());
712
713 if (image == nullptr)
714 {
715 mitkThrow() << "Cannot write non-image data";
716 }
717
718 PreparImageIOToWriteImage(m_ImageIO, image);
719
720 LocalFile localFile(this);
721 const std::string path = localFile.GetFileName();
722
723 MITK_INFO << "Writing image: " << path << std::endl;
724
725 try
726 {
727 // Handle properties
728 SavePropertyListAsMetaData(m_ImageIO->GetMetaDataDictionary(), image->GetPropertyList(), this->GetMimeType()->GetName());
729 // Handle UID
730 itk::EncapsulateMetaData<std::string>(m_ImageIO->GetMetaDataDictionary(), PROPERTY_KEY_UID, image->GetUID());
731
732 // use compression if available
733 m_ImageIO->UseCompressionOn();
734 m_ImageIO->SetFileName(path);
735
736 ImageReadAccessor imageAccess(image);
737 LocaleSwitch localeSwitch2("C");
738 m_ImageIO->Write(imageAccess.GetData());
739 }
740 catch (const std::exception &e)
741 {
742 mitkThrow() << e.what();
743 }
744 }
745
746 AbstractFileIO::ConfidenceLevel ItkImageIO::GetWriterConfidenceLevel() const
747 {

Callers 8

TakeScreenshotFunction · 0.45
SaveSliceOrImageAsPNGFunction · 0.45
SaveSliceOrImageAsPNGFunction · 0.45
SaveMethod · 0.45
RecordFrameMethod · 0.45
SaveAsPNGMethod · 0.45
TakeScreenshotMethod · 0.45

Calls 9

whatMethod · 0.80
GetInputMethod · 0.45
GetFileNameMethod · 0.45
GetPropertyListMethod · 0.45
GetNameMethod · 0.45
GetMimeTypeMethod · 0.45
GetUIDMethod · 0.45
SetFileNameMethod · 0.45
GetDataMethod · 0.45

Tested by 1

SaveAsPNGMethod · 0.36