Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F681
NRRD_ImageWriting.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
hering
Jun 24 2011, 5:28 PM
2011-06-24 17:28:53 (UTC+2)
Size
1 KB
Referenced Files
None
Subscribers
None
NRRD_ImageWriting.patch
View Options
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
Details
Attached
Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
656
Default Alt Text
NRRD_ImageWriting.patch (1 KB)
Attached To
Mode
T8211: NRRD format does not save 4D images
Attached
Detach File
Event Timeline
•
hering
added a comment.
Jun 24 2011, 5:28 PM
2011-06-24 17:28:53 (UTC+2)
Comment Actions
proposed modification to the mitk::ImageWriter class
Log In to Comment