]> Creatis software - clitk.git/commitdiff
added metadata to vv
authorBenoît Presles <benoit.presles@creatis.insa-lyon.fr>
Fri, 29 Mar 2013 15:26:58 +0000 (16:26 +0100)
committerBenoît Presles <benoit.presles@creatis.insa-lyon.fr>
Fri, 29 Mar 2013 15:26:58 +0000 (16:26 +0100)
common/vvImage.cxx
common/vvImage.h
common/vvImage.txx
segmentation/clitkExtractPatientGenericFilter.txx
vv/qt_ui/vvInfoPanel.ui
vv/vvInfoPanel.cxx
vv/vvInfoPanel.h
vv/vvMainWindow.cxx

index 31c6ef0fecd8234ecde506d542a8884b2293e84b..9842d4a7f2f64945580c53a6779b82957f561e55 100644 (file)
@@ -269,6 +269,11 @@ bool vvImage::HaveSameSizeAndSpacingThan(vvImage * other)
   return same;
 }
 //--------------------------------------------------------------------
+itk::MetaDataDictionary* vvImage::GetFirstMetaDataDictionary()
+{
+    return mDictionary[0];
+}
+//--------------------------------------------------------------------
 
 
 #endif // VVIMAGE_CXX
index a120457f6f9f5a5f375f22cd426f5262cf05af9e..7240be82c4ef5843a221ed34930d4b0691dc8ea5 100644 (file)
@@ -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<vtkTransform> > mTransform;
+  //META DATA
+  std::vector< itk::MetaDataDictionary* > mDictionary;
 
   double mTimeOrigin;
   double mTimeSpacing;
index 55b785fb4814571fd4c0a7788699d03c848b937f..a6d37c8cbbd8f0447f69c990235fa0963afedb53 100644 (file)
@@ -52,6 +52,8 @@ void vvImage::AddItkImage(TItkImageType *input)
 
   mTransform.push_back(vtkSmartPointer<vtkTransform>::New());
   mTransform.back()->SetMatrix(matrix);
+  //META DATA
+  mDictionary.push_back(&(input->GetMetaDataDictionary()));
 }
 //--------------------------------------------------------------------
 
index 7bb97561c6d84b69f018434b93a4f392bc286a4e..ae87cc8363afc36d6225d90cb36fef33505dec6b 100644 (file)
@@ -36,6 +36,8 @@ template<unsigned int Dim>
 void clitk::ExtractPatientGenericFilter<ArgsInfoType>::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);
 }
index 17d4e8ffa21d51799a57088106f3d78b050129e4..b0b8d39d879bbff1b9faed78be1c21baaf00dfdb 100644 (file)
@@ -58,7 +58,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="1" column="0">
+       <item row="2" column="0">
         <widget class="QLabel" name="dimensionStaticLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@@ -75,7 +75,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="1" column="1">
+       <item row="2" column="1">
         <widget class="QLabel" name="dimensionLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@@ -88,7 +88,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="2" column="0">
+       <item row="3" column="0">
         <widget class="QLabel" name="sizePixelStaticLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@@ -105,7 +105,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="2" column="1">
+       <item row="3" column="1">
         <widget class="QLabel" name="sizePixelLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@@ -118,7 +118,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="3" column="0">
+       <item row="4" column="0">
         <widget class="QLabel" name="sizeMMStaticLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@@ -135,7 +135,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="3" column="1">
+       <item row="4" column="1">
         <widget class="QLabel" name="sizeMMLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@@ -148,7 +148,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="4" column="0">
+       <item row="5" column="0">
         <widget class="QLabel" name="originStaticLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@@ -165,7 +165,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="4" column="1">
+       <item row="5" column="1">
         <widget class="QLabel" name="originLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@@ -178,7 +178,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="5" column="0">
+       <item row="6" column="0">
         <widget class="QLabel" name="spacingStaticLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@@ -195,7 +195,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="5" column="1">
+       <item row="6" column="1">
         <widget class="QLabel" name="spacingLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@@ -208,7 +208,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="6" column="0">
+       <item row="7" column="0">
         <widget class="QLabel" name="nPixelStaticLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@@ -224,7 +224,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="6" column="1">
+       <item row="7" column="1">
         <widget class="QLabel" name="nPixelLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@@ -237,7 +237,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="7" column="0">
+       <item row="8" column="0">
         <widget class="QLabel" name="mouseStaticLabel_2">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -253,14 +253,14 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="7" column="1">
+       <item row="8" column="1">
         <widget class="QLabel" name="mouseLabel">
          <property name="text">
           <string/>
          </property>
         </widget>
        </item>
-       <item row="8" column="0">
+       <item row="9" column="0">
         <widget class="QLabel" name="pixelPosStaticLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -276,7 +276,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="8" column="1">
+       <item row="9" column="1">
         <widget class="QLabel" name="pixelPosLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@@ -289,7 +289,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="9" column="0">
+       <item row="10" column="0">
         <widget class="QLabel" name="worldPosStaticLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -305,7 +305,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="9" column="1">
+       <item row="10" column="1">
         <widget class="QLabel" name="worldPosLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@@ -318,7 +318,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="10" column="0">
+       <item row="11" column="0">
         <widget class="QLabel" name="valueStaticLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -334,7 +334,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="10" column="1">
+       <item row="11" column="1">
         <widget class="QLabel" name="valueLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@@ -347,14 +347,14 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="11" column="1">
+       <item row="12" column="1">
         <widget class="QLabel" name="ViewsLabel">
          <property name="text">
           <string/>
          </property>
         </widget>
        </item>
-       <item row="15" column="0" colspan="2">
+       <item row="16" column="0" colspan="2">
         <widget class="QLabel" name="transformationLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@@ -376,7 +376,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="13" column="0">
+       <item row="14" column="0">
         <widget class="QLabel" name="TransformationStaticLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@@ -393,7 +393,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="17" column="0">
+       <item row="18" column="0">
         <widget class="QLabel" name="memoryUsageLabel">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -417,7 +417,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="12" column="0">
+       <item row="13" column="0">
         <spacer name="verticalSpacer">
          <property name="orientation">
           <enum>Qt::Vertical</enum>
@@ -430,6 +430,39 @@ p, li { white-space: pre-wrap; }
          </property>
         </spacer>
        </item>
+       <item row="1" column="0">
+        <widget class="QLabel" name="creationTimeStaticLabel">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="mouseTracking">
+          <bool>true</bool>
+         </property>
+         <property name="text">
+          <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;  Creation time :&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QLabel" name="creationTimeLabel">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="text">
+          <string/>
+         </property>
+        </widget>
+       </item>
       </layout>
      </widget>
     </widget>
index 9aa3e57f448a66a64a42b1b660a49de6174382ac..2a4d1032b531c34c8fa2f39b3ed7836801e0697c 100644 (file)
@@ -52,6 +52,10 @@ void vvInfoPanel::setFileName(QString text)
 }
 //------------------------------------------------------------------------------
 
+void vvInfoPanel::setImageCreationTime(QString text)
+{
+  creationTimeLabel->setText(text);
+}
 
 //------------------------------------------------------------------------------
 void vvInfoPanel::setDimension(QString text)
index 4a665e1aaa34ba09029fa843a5130cf5feabc43c..6db1e9bb4a4059ebf542d1fa8e0b5ed0554edb65 100644 (file)
@@ -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);
index a06870f5baf2074d74856776a9b49c36ff9e0adf..101aff9de0f8aa9b1c5562d244071a99cc4d6310 100644 (file)
@@ -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));