Page MenuHomePhabricator

NRRD_ImageWriting.patch

Authored By
hering
Jun 24 2011, 5:28 PM
Size
1 KB
Referenced Files
None
Subscribers
None

NRRD_ImageWriting.patch

diff --git a/Core/Code/IO/mitkImageWriter.cpp b/Core/Code/IO/mitkImageWriter.cpp
index 64602ea..a1eb3ac 100644
--- a/Core/Code/IO/mitkImageWriter.cpp
+++ b/Core/Code/IO/mitkImageWriter.cpp
@@ -142,7 +142,9 @@ void mitk::ImageWriter::GenerateData()
bool vti = (m_Extension.find(".vti") != std::string::npos);
#endif
- if ( m_Extension.find(".pic") == std::string::npos )
+ // If the extension is NOT .pic and NOT .nrrd the following block is entered
+ if ( m_Extension.find(".pic") == std::string::npos
+ && m_Extension.find(".nrrd") == std::string::npos)
{
if(input->GetDimension() > 3)
{
@@ -196,6 +198,9 @@ void mitk::ImageWriter::GenerateData()
}
else
{
+ // use the PicFileWriter for the .pic data type
+ if( m_Extension.find(".pic") != std::string::npos )
+ {
PicFileWriter::Pointer picWriter = PicFileWriter::New();
size_t found;
found = m_FileName.find( m_Extension ); // !!! HAS to be at the very end of the filename (not somewhere in the middle)
@@ -212,6 +217,16 @@ void mitk::ImageWriter::GenerateData()
}
picWriter->SetInput( input );
picWriter->Write();
+ }
+
+ // use the ITK .nrrd Image writer
+ if( m_Extension.find(".nrrd") != std::string::npos )
+ {
+ ::itk::OStringStream filename;
+ filename << this->m_FileName.c_str() << this->m_Extension;
+ WriteByITK(input, filename.str());
+ }
+
}
m_MimeType = "application/MITK.Pic";
}

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
656
Default Alt Text
NRRD_ImageWriting.patch (1 KB)

Event Timeline

proposed modification to the mitk::ImageWriter class