]> Creatis software - creaImageIO.git/commitdiff
Allow MHD convertion
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Mon, 12 Oct 2009 22:53:15 +0000 (22:53 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Mon, 12 Oct 2009 22:53:15 +0000 (22:53 +0000)
bbtk/src/bbcreaImageIOGimmick.xml_v2
src2/creaImageIOWxGimmickTools.cpp
src2/creaImageIOWxGimmickTools.h
src2/creaImageIOWxGimmickView.cpp
src2/creaImageIOWxGimmickView.h

index 4628f10966e26118aa443e0b8a5e7efa7f7541bd..5d2cd547ee65489b38eb2b2348e75c0c80315aaa 100644 (file)
  <!--========================================================================
     INPUTS/OUTPUTS DECLARATION -->
 
-  <input name="Title" type="std::string" description="Title of the dialog"/>
-  <input name="ImageMinDimension" type="int" description="The minimal dimensionality of the image to be selected, e.g. 2 for a 2D image, 3 for a 3D image,..."/>
-  <input name="ImageMaxDimension" type="int" description="The maximal dimensionality of the image to be selected, e.g. 2 for a 2D image, 3 for a 3D image,..."/>
-  <input name="ImageOutputDimension" type="int" description="The dimensionality of the output image, e.g. 2 for a 2D image, 3 for a 3D image,..."/>
-  <input name="Output" type="int" description="What to output ? 0(default)=image and filenames/1=only filenames"/>
-  <typedef><PRE>typedef std::vector<std::string> OutputFilesType;</PRE></typedef>
+  <input name="Title"                type="std::string" description="Title of the dialog"/>
+  <input name="ImageMinDimension"    type="int"         description="The minimal dimensionality of the image to be selected, e.g. 2 for a 2D image, 3 for a 3D image,..."/>
+  <input name="ImageMaxDimension"    type="int"         description="The maximal dimensionality of the image to be selected, e.g. 2 for a 2D image, 3 for a 3D image,..."/>
+  <input name="ImageOutputDimension" type="int"         description="The dimensionality of the output image, e.g. 2 for a 2D image, 3 for a 3D image,..."/>
+  <input name="Output"               type="int"         description="What to output ? 0(default)=image and filenames/1=only filenames"/>
+
+  <typedef><PRE>typedef std::vector<std::string>   OutputFilesType; </PRE></typedef>
   <typedef><PRE>typedef std::vector<vtkImageData*> OutputImagesType;</PRE></typedef>
 
- <output name="Out" type="vtkImageData*" description="The first selected image"/>
- <output name="Out2" type="OutputImagesType" description="The selected images"/>
- <output name="Files" type="OutputFilesType" description="The selected files"/>
+ <output name="Out"   type="vtkImageData*"    description="The first selected image"/>
+ <output name="Out2"  type="OutputImagesType" description="The selected images"/>
+ <output name="Files" type="OutputFilesType"  description="The selected files"/>
  
  <!--========================================================================
     PROCESS section -->
@@ -61,9 +62,9 @@
      {
 //    if (bbGetOutputOut()!=0) 
 //     { 
- //       bbGetOutputOut()->Delete();    
+//       bbGetOutputOut()->Delete();
 //          bbSetOutputOut(0);
-// }
+//     }
      }
   </PRE></process>
 
index fc978c76c28b9028f54b52c10be9f467ef3b0db3..6bbcec286eefaba0de0912f21b2ee2f1ea43fd28 100644 (file)
@@ -11,21 +11,25 @@ namespace creaImageIO
        {
                _currentDir = mCurrentDirectory;
                _addFiles = true;
+               _mhd      = false;
 
-               _inputPath   = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxSize(400,30));
-               _outputPath  = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxSize(400,30));
-               _addCheckBox = new wxCheckBox(this, -1,       _T("Add Images to Database?") );
+               _inputPath      = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxSize(400,30));
+               _outputPath     = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxSize(400,30));
+               _addCheckBox    = new wxCheckBox(this, -1,       _T("Add Images to Database?") );
+               _mhdCheckBox    = new wxCheckBox(this, -1,       _T("Convert to MHD?") );
                _addCheckBox->SetValue(_addFiles);
+               _mhdCheckBox->SetValue(_mhd);           
 
-               wxButton *inputDir  = new wxButton(this,wxID_ANY,_T("Input Directory"),  wxDefaultPosition, wxSize(140,30) );
-               wxButton *outputDir = new wxButton(this,wxID_ANY,_T("Output Directory"), wxDefaultPosition, wxSize(140,30) );
+               wxButton *inputDir  = new wxButton(this, wxID_ANY,_T("Input Directory"),  wxDefaultPosition, wxSize(140,30) );
+               wxButton *outputDir = new wxButton(this, wxID_ANY,_T("Output Directory"), wxDefaultPosition, wxSize(140,30) );
 
                Connect( inputDir->GetId(),     wxEVT_COMMAND_BUTTON_CLICKED ,  (wxObjectEventFunction) &WxGimmickTools::onInputDir ); 
                Connect( outputDir->GetId(),    wxEVT_COMMAND_BUTTON_CLICKED ,  (wxObjectEventFunction) &WxGimmickTools::onOutputDir );
                Connect( _addCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WxGimmickTools::onAddToDatabase );
-
+               Connect( _mhdCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WxGimmickTools::onMHD );
+               
                wxFlexGridSizer *textSizer = new wxFlexGridSizer(1,2);
-               textSizer->Add( new wxStaticText(this, -1, _T("Transform a Bruker image into Dicom format.")),                1, wxGROW );
+               textSizer->Add( new wxStaticText(this, -1, _T("Transform a Bruker image into Dicom / MHD format.")),          1, wxGROW );
                textSizer->Add( new wxStaticText(this, -1, _T("If checkbox is selected images will be loaded into the DB.")), 1, wxGROW );
 
                wxFlexGridSizer *sizer  = new wxFlexGridSizer(2,5);
@@ -38,10 +42,11 @@ namespace creaImageIO
                sizer->Add( new wxStaticText(this, -1, _T(" ")), 1, wxGROW );
                sizer->Add( new wxStaticText(this, -1, _T(" ")), 1, wxGROW );
                sizer->Add( _addCheckBox, 1, wxGROW );
-
+               sizer->Add( _mhdCheckBox, 1, wxGROW );
+               
                wxFlexGridSizer *topSizer = new wxFlexGridSizer(1, 2);
                topSizer->Add( textSizer, 1, wxGROW );
-               topSizer->Add( sizer, 1, wxGROW );
+               topSizer->Add( sizer,     1, wxGROW );
                this->SetSizer( topSizer );
                this->SetAutoLayout( true );
                this->Layout();
@@ -62,10 +67,15 @@ namespace creaImageIO
                return _outputPath->GetValue();
        }
 
-       bool WxGimmickTools::getCheckBoxValue()
+       bool WxGimmickTools::getAddToDBCheckBoxValue()
        {
                return _addCheckBox->GetValue();
        }
+       
+       bool WxGimmickTools::getMHDCheckBoxValue()
+       {
+               return _mhdCheckBox->GetValue();
+       }       
 
        void WxGimmickTools::onInputDir(wxCommandEvent& event)
        {
@@ -93,6 +103,11 @@ namespace creaImageIO
        {
                _addFiles = _addCheckBox->GetValue();
        }
+       
+       void WxGimmickTools::onMHD(wxCommandEvent& event)
+       {
+               _mhd = _mhdCheckBox->GetValue();
+       }       
 
 } // EO namespace creaImageIO
 
index d4ec04d46862fdecfe3c36a760a7d215976f2256..88e862f5aff694c853b31fb07e195852a7afeec1 100644 (file)
@@ -11,7 +11,7 @@ namespace creaImageIO
    * \ingroup Tools
    */
   //=====================================================================
-  
+
   //=====================================================================
 
   class WxGimmickTools : public wxPanel
@@ -19,21 +19,23 @@ namespace creaImageIO
        public:
                WxGimmickTools(wxWindow *parent, wxString mCurrentDirectory);           
                ~WxGimmickTools();
-               
+
                wxString getInputDir();
                wxString getOutputDir();
-               bool getCheckBoxValue();
-               
+               bool getAddToDBCheckBoxValue();
+               bool getMHDCheckBoxValue();
        private:
-               wxCheckBox * _addCheckBox;      
+               wxCheckBox * _addCheckBox;
+               wxCheckBox * _mhdCheckBox;
                wxTextCtrl * _inputPath;
                wxTextCtrl * _outputPath;
                wxString _currentDir;
                bool _addFiles;
+               bool _mhd;
                void onInputDir(wxCommandEvent& event);
                void onOutputDir(wxCommandEvent& event);
                void onAddToDatabase(wxCommandEvent& event);
-    
+               void onMHD(wxCommandEvent& event);
        };
   
 } // EO namespace creaImageIO
index bc12bf4694b22acd6110a7723746ee31b7ee5d90..f187decb48c5390a4f478b819300b3fda1609714 100644 (file)
@@ -829,7 +829,7 @@ namespace creaImageIO
                        std::string inputDir  = crea::wx2std(gimmickTools->getInputDir());
                        std::string outputDir = crea::wx2std(gimmickTools->getOutputDir());
                        
-                       bool addToDB = gimmickTools->getCheckBoxValue();
+                       bool addToDB = gimmickTools->getAddToDBCheckBoxValue();
 
                        if (inputDir.compare("")!=0 && outputDir.compare("")!=0)
                        {
index f08e937cfadc2d30eb91b973b75d17a3c354922b..53dcf77c5e540a36f07a5baf1f71cae2e3f38a34 100644 (file)
@@ -69,9 +69,9 @@ namespace creaImageIO
     ///Resets the default image
     void ClearSelection();
        ///Copies selected files
-       void CopyFiles(const std::vector<std::string>& filenames);
+    void CopyFiles(const std::vector<std::string>& filenames);
        ///Add selected files to the Database
-       void AddDir(std::string dirName);
+    void AddDir(std::string dirName);
     
     
     ///Sends a request to read the currently selected node and the ones that surround it.