From 2f9fc22f1046c8aa24a0840e6c953132aca1c120 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Beno=C3=AEt=20Presles?= Date: Fri, 29 Mar 2013 16:26:58 +0100 Subject: [PATCH] added metadata to vv --- common/vvImage.cxx | 5 ++ common/vvImage.h | 4 + common/vvImage.txx | 2 + .../clitkExtractPatientGenericFilter.txx | 2 + vv/qt_ui/vvInfoPanel.ui | 83 +++++++++++++------ vv/vvInfoPanel.cxx | 4 + vv/vvInfoPanel.h | 1 + vv/vvMainWindow.cxx | 3 + 8 files changed, 79 insertions(+), 25 deletions(-) diff --git a/common/vvImage.cxx b/common/vvImage.cxx index 31c6ef0..9842d4a 100644 --- a/common/vvImage.cxx +++ b/common/vvImage.cxx @@ -269,6 +269,11 @@ bool vvImage::HaveSameSizeAndSpacingThan(vvImage * other) return same; } //-------------------------------------------------------------------- +itk::MetaDataDictionary* vvImage::GetFirstMetaDataDictionary() +{ + return mDictionary[0]; +} +//-------------------------------------------------------------------- #endif // VVIMAGE_CXX diff --git a/common/vvImage.h b/common/vvImage.h index a120457..7240be8 100644 --- a/common/vvImage.h +++ b/common/vvImage.h @@ -60,6 +60,8 @@ public : void SetTimeSpacing(double s) { mTimeSpacing = s; } void SetTimeOrigin(double o) { mTimeOrigin = o; } bool HaveSameSizeAndSpacingThan(vvImage * other); + //META DATA + itk::MetaDataDictionary* GetFirstMetaDataDictionary(); private: vvImage(); @@ -68,6 +70,8 @@ private: std::vector< ConverterPointer > mItkToVtkConverters; std::vector< vtkImageData* > mVtkImages; std::vector< vtkSmartPointer > mTransform; + //META DATA + std::vector< itk::MetaDataDictionary* > mDictionary; double mTimeOrigin; double mTimeSpacing; diff --git a/common/vvImage.txx b/common/vvImage.txx index 55b785f..a6d37c8 100644 --- a/common/vvImage.txx +++ b/common/vvImage.txx @@ -52,6 +52,8 @@ void vvImage::AddItkImage(TItkImageType *input) mTransform.push_back(vtkSmartPointer::New()); mTransform.back()->SetMatrix(matrix); + //META DATA + mDictionary.push_back(&(input->GetMetaDataDictionary())); } //-------------------------------------------------------------------- diff --git a/segmentation/clitkExtractPatientGenericFilter.txx b/segmentation/clitkExtractPatientGenericFilter.txx index 7bb9756..ae87cc8 100644 --- a/segmentation/clitkExtractPatientGenericFilter.txx +++ b/segmentation/clitkExtractPatientGenericFilter.txx @@ -36,6 +36,8 @@ template void clitk::ExtractPatientGenericFilter::InitializeImageType() { ADD_IMAGE_TYPE(Dim, short); + ADD_IMAGE_TYPE(Dim, unsigned short); + ADD_IMAGE_TYPE(Dim, float); // ADD_IMAGE_TYPE(Dim, int); // ADD_IMAGE_TYPE(Dim, float); } diff --git a/vv/qt_ui/vvInfoPanel.ui b/vv/qt_ui/vvInfoPanel.ui index 17d4e8f..b0b8d39 100644 --- a/vv/qt_ui/vvInfoPanel.ui +++ b/vv/qt_ui/vvInfoPanel.ui @@ -58,7 +58,7 @@ p, li { white-space: pre-wrap; } - + @@ -75,7 +75,7 @@ p, li { white-space: pre-wrap; } - + @@ -88,7 +88,7 @@ p, li { white-space: pre-wrap; } - + @@ -105,7 +105,7 @@ p, li { white-space: pre-wrap; } - + @@ -118,7 +118,7 @@ p, li { white-space: pre-wrap; } - + @@ -135,7 +135,7 @@ p, li { white-space: pre-wrap; } - + @@ -148,7 +148,7 @@ p, li { white-space: pre-wrap; } - + @@ -165,7 +165,7 @@ p, li { white-space: pre-wrap; } - + @@ -178,7 +178,7 @@ p, li { white-space: pre-wrap; } - + @@ -195,7 +195,7 @@ p, li { white-space: pre-wrap; } - + @@ -208,7 +208,7 @@ p, li { white-space: pre-wrap; } - + @@ -224,7 +224,7 @@ p, li { white-space: pre-wrap; } - + @@ -237,7 +237,7 @@ p, li { white-space: pre-wrap; } - + @@ -253,14 +253,14 @@ p, li { white-space: pre-wrap; } - + - + @@ -276,7 +276,7 @@ p, li { white-space: pre-wrap; } - + @@ -289,7 +289,7 @@ p, li { white-space: pre-wrap; } - + @@ -305,7 +305,7 @@ p, li { white-space: pre-wrap; } - + @@ -318,7 +318,7 @@ p, li { white-space: pre-wrap; } - + @@ -334,7 +334,7 @@ p, li { white-space: pre-wrap; } - + @@ -347,14 +347,14 @@ p, li { white-space: pre-wrap; } - + - + @@ -376,7 +376,7 @@ p, li { white-space: pre-wrap; } - + @@ -393,7 +393,7 @@ p, li { white-space: pre-wrap; } - + @@ -417,7 +417,7 @@ p, li { white-space: pre-wrap; } - + Qt::Vertical @@ -430,6 +430,39 @@ p, li { white-space: pre-wrap; } + + + + + 0 + 0 + + + + true + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;"><span style=" font-weight:600;"> Creation time :</span></p></body></html> + + + + + + + + 0 + 0 + + + + + + + diff --git a/vv/vvInfoPanel.cxx b/vv/vvInfoPanel.cxx index 9aa3e57..2a4d103 100644 --- a/vv/vvInfoPanel.cxx +++ b/vv/vvInfoPanel.cxx @@ -52,6 +52,10 @@ void vvInfoPanel::setFileName(QString text) } //------------------------------------------------------------------------------ +void vvInfoPanel::setImageCreationTime(QString text) +{ + creationTimeLabel->setText(text); +} //------------------------------------------------------------------------------ void vvInfoPanel::setDimension(QString text) diff --git a/vv/vvInfoPanel.h b/vv/vvInfoPanel.h index 4a665e1..6db1e9b 100644 --- a/vv/vvInfoPanel.h +++ b/vv/vvInfoPanel.h @@ -32,6 +32,7 @@ public: void setTransformation(QString text); void setFileName(QString text); + void setImageCreationTime(QString text); void setSizeMM(QString text); void setOrigin(QString text); void setSpacing(QString text); diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index a06870f..101aff9 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -1134,6 +1134,9 @@ void vvMainWindow::ImageInfoChanged() dim += pixelType + ")"; infoPanel->setFileName(image); + std::string creationImageTimeValue("No creation time"); + itk::ExposeMetaData< std::string > (*imageSelected->GetFirstMetaDataDictionary(), "creationImageTime", creationImageTimeValue); + infoPanel->setImageCreationTime(QString(creationImageTimeValue.c_str())); infoPanel->setDimension(dim); infoPanel->setSizePixel(GetVectorIntAsString(inputSize)); infoPanel->setSizeMM(GetVectorDoubleAsString(sizeMM)); -- 2.47.1