]> Creatis software - creaImageIO.git/commitdiff
#3264 creaImageIO Feature New Normal - Add Dicom Tags to the DB sqlite
authorEduardo DAVILA <davila@ei-ed-606.creatis.insa-lyon.fr>
Mon, 17 Jun 2019 10:40:22 +0000 (12:40 +0200)
committerEduardo DAVILA <davila@ei-ed-606.creatis.insa-lyon.fr>
Mon, 17 Jun 2019 10:40:22 +0000 (12:40 +0200)
bbtk/src/bbcreaImageIOImagesChooserDialogBox.xml
src/creaImageIODicomImageReader.cpp
src/creaImageIOGimmickView.cpp
src/creaImageIOImageReader.cpp
src/creaImageIOMultiThreadImageReader.cpp
src/creaImageIOWxGimmickView.cpp
src/data/localdatabase_Descriptor.dscp

index 96c25ddc79224bf9618c0bddabf1fff3f63475a5..7463747c22122808618cc33865c8aa85232de67d 100644 (file)
@@ -79,6 +79,9 @@
 
   <process>
     <PRE>
+
+printf("EED ImagesChooserDialogBox Start\n");
+
 //    creaImageIO::WxSimpleDlg dlg(0,crea::std2wx(bbGetInputTitle()),"localdatabase_Descriptor.dscp","Local Database"); 
     creaImageIO::WxSimpleDlg *dlg = new creaImageIO::WxSimpleDlg(0,crea::std2wx(bbGetInputTitle()),"localdatabase_Descriptor.dscp","Local Database"); 
     dlg->SetAttrDicomTags( bbGetInputDicomTags() );
@@ -95,7 +98,9 @@
        bbSignalOutputModification(  );
        
        delete dlg;
+printf("EED ImagesChooserDialogBox END \n");
        
+
     </PRE>
   </process>
 
index 7f608f016d9815f334e98a15831eeb2599a7b470..d97634a610592dba38c2a47ab935ca74b75d9e57 100644 (file)
@@ -82,17 +82,26 @@ namespace creaImageIO
   //=====================================================================
   vtkImageData* DicomImageReader::ReadImage(const std::string& filename)
   {
+printf("EED DicomImageReader::ReadImage Start\n");
     vtkImageData* im = 0;
     try
     {
+printf("EED DicomImageReader::ReadImage 1\n");
                mReader->SetFileName(filename.c_str());
+printf("EED DicomImageReader::ReadImage 2 aaaaaaaaaaaaaaaaaaaaaaaaaaa\n");
                mReader->Update();
+printf("EED DicomImageReader::ReadImage 3 bbbbbbbbbbbbbbbbbbbbbbbbbbb\n");
                im = vtkImageData::New();
+printf("EED DicomImageReader::ReadImage 4\n");
                im->ShallowCopy(mReader->GetOutput());
+printf("EED DicomImageReader::ReadImage 5\n");
     } catch (...) {
+printf("EED DicomImageReader::ReadImage 6\n");
                if (im!=0) im->Delete();
                im = 0;
     }
+printf("EED DicomImageReader::ReadImage End\n");
+
     return im;
   }
 
index 47aa9cb2f1b817e8ec386fae312d88481f139cf0..2ff7855fdb30222137cfbde27148fe8bba39f624 100644 (file)
@@ -464,8 +464,10 @@ void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s, std::vect
        //////////////////////////////////////////////////////////
        bool GimmickView::isSingle(const std::string i_file)
        {
+printf("EED GimmickView::isSingle Start %s\n" , i_file.c_str() );
                bool bres = true;
                vtkImageData* first = mReader.GetImage( i_file);
+printf("EED GimmickView::isSingle 1\n"  );
                int dim[3];
                first->GetDimensions(dim);
                if (dim[2] > 1)
@@ -475,6 +477,8 @@ void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s, std::vect
                else
                {
                }
+printf("EED GimmickView::isSingle end\n");
+
                return bres;
        }
 
index c3b9070ff9671f736b69dc1a69637dbbe6f3bcb2..ecba3edb1fe35fe15db60215694920174b576a00 100644 (file)
@@ -157,6 +157,8 @@ namespace creaImageIO
   // Returns true iff the file is readable
   bool ImageReader::CanRead( const std::string& filename ) 
   {
+printf("EED ImageReader::CanRead Start\n");
+
     bool ok = false;
 
        if( !ShallNotRead(filename))
@@ -173,10 +175,13 @@ namespace creaImageIO
                        {
                                mLastFilename = filename;
                                mLastReader = *i;
+printf("EED ImageReader::CanRead %s\n",mLastReader->GetName().c_str());
                                break;
                        }
                }
        }
+if (ok==true) printf("EED ImageReader::CanRead true End\n");
+if (ok==false) printf("EED ImageReader::CanRead false End\n");
        return ok;
   }
   //=====================================================================
@@ -185,21 +190,29 @@ namespace creaImageIO
   // Reads the file (CanRead must be called before : no test here)
   vtkImageData*  ImageReader::ReadImage( const std::string& filename)
   {
+printf("EED ImageReader::ReadImage Start\n");
                if (mLastFilename!=filename)
                {
+printf("EED ImageReader::ReadImage 1\n");
                        if (!CanRead(filename))  
                        { 
+printf("EED ImageReader::ReadImage 2\n");
                                vtkImageData* im = vtkImageData::New();
                                im->ShallowCopy(mUnreadableImage);
+printf("EED ImageReader::ReadImage END2\n");
                                return im;
                        } // CanRead
                } // for mLastFilename
+printf("EED ImageReader::ReadImage 3\n");
                vtkImageData* i = mLastReader->ReadImage(mLastFilename);
+printf("EED ImageReader::ReadImage 4\n");
                if (i==NULL) 
                {
                        i = vtkImageData::New();
                        i->ShallowCopy(mUnreadableImage);
                } // i
+printf("EED ImageReader::ReadImage END1\n");
+
                return i;
   }
   //=====================================================================
index d0103d7e02ce6b3b65d703370378ca0e64544a31..d0bea26af3862176ba5f167aebc2555828093c94 100644 (file)
@@ -372,9 +372,9 @@ namespace creaImageIO
   //=====================================================================
   vtkImageData* MultiThreadImageReader::GetImage(const std::string& filename)
   {
-        // Start();
-    //       std::cout << "** MultiThreadImageReader::GetImage('"<<filename<<"')"
-    //          <<std::endl;
+
+       printf("EED MultiThreadImageReader::GetImage  Start\n");        
+
     
     do 
       {
@@ -388,11 +388,15 @@ namespace creaImageIO
        //      if (mThreadedImageReaderList.size()==0)
        if (true)
        {
+       printf("EED MultiThreadImageReader::GetImage  1\n");    
            ImageToLoad itl(this,filename);
+       printf("EED MultiThreadImageReader::GetImage  2\n");    
            ImageMapType::iterator i = mImages.find(&itl);
            if (i!=mImages.end())
            {
+       printf("EED MultiThreadImageReader::GetImage  2.1\n");  
                        ImageToLoadPtr pitl = const_cast<ImageToLoadPtr>(i->first);
+       printf("EED MultiThreadImageReader::GetImage  2.2\n");  
                        // Already inserted
                        if (pitl->GetImage() != NULL)
                        {
@@ -402,10 +406,14 @@ namespace creaImageIO
                        } // if pitl->GetImage()
            } // if i
                
+       printf("EED MultiThreadImageReader::GetImage  3.1\n");  
            ImageToLoadPtr pitl = new ImageToLoad(this,filename,0);
+       printf("EED MultiThreadImageReader::GetImage  3.2\n");  
            mImages[pitl]               = NULL;
            pitl->SetImage( mReader->ReadImage(filename) );
+       printf("EED MultiThreadImageReader::GetImage  3.3\n");  
            UpdateUnloadPriority( pitl, GetMaximalPriorityWithoutLocking()+1 );
+       printf("EED MultiThreadImageReader::GetImage  3.4\n");  
            return pitl->GetImage();
        } // if true
        
index c4b2edbbe6bacc4a4dd78084d28507144936b83e..63d4f4257ad3aac2b3162e1664a315f8fc01c87e 100644 (file)
@@ -351,18 +351,28 @@ namespace creaImageIO
   void WxGimmickView::getSelectedFiles(std::vector<OutStrGimmick> &outG, std::vector< std::string> i_attr, 
                                        bool mult, const std::string out_model)
   {
+printf("EED WxGimmickView::getSelectedFiles Start\n");
+
        // First we select the files
    std::vector<std::string> files;
+printf("EED WxGimmickView::getSelectedFiles 1.1\n");
        std::string db_name = crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()));
+printf("EED WxGimmickView::getSelectedFiles 1.2\n");
        GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->GetSelectedAsString(files);
+printf("EED WxGimmickView::getSelectedFiles 1.3\n");
 
        std::string asking;
        std::string dim;
-       bool bsingle = isSingle(files.front());
+printf("EED WxGimmickView::getSelectedFiles 1.3.1\n");
+       bool bsingle = isSingle( files.front() );
+printf("EED WxGimmickView::getSelectedFiles 1.3.2\n");
        int i_dim_out;
+printf("EED WxGimmickView::getSelectedFiles 1.4\n");
        mGimmick->GetSetting(SETTINGS_OUTPUT_ASK, asking);
+printf("EED WxGimmickView::getSelectedFiles 1.5\n");
        mGimmick->GetSetting(SETTINGS_OUTPUT_DIM, dim);
 
+printf("EED WxGimmickView::getSelectedFiles 1.6\n");
 
        if (asking == "true")
        {
@@ -370,7 +380,9 @@ namespace creaImageIO
                // get dim
                int idim;
                sscanf(dim.c_str(),"%d",&idim);
+printf("EED WxGimmickView::getSelectedFiles 1.7\n");
                WxOutputDlg *dlg = new WxOutputDlg(this,files, idim -1, bsingle);
+printf("EED WxGimmickView::getSelectedFiles 1.8\n");
                if (dlg->ShowModal() == wxID_OK)
                {
                        dim = dlg->getDim();
@@ -383,6 +395,9 @@ namespace creaImageIO
        }
        sscanf(dim.c_str(),"%d",&i_dim_out);
 
+printf("EED WxGimmickView::getSelectedFiles 2\n");
+
+
        // Next we create the structure for dicom output infos
        OutputAttr Oattr;
 //EED 01/09/2014
@@ -426,6 +441,9 @@ namespace creaImageIO
        }
        // Now we read and create the waiting output (vtkImageData * or OutGimmickData *)
        readImages(outG, sort_files, Oattr, i_dim_out, zspacing);
+
+printf("EED WxGimmickView::getSelectedFiles End\n");
+
   }
 
 
index 402931bf0fe8fff48265f06317a5b45e92afb43c..63cc5162a7ed0560f73e60aa12a68b5d073af344 100644 (file)
@@ -30,6 +30,8 @@ D 0x0020 0x000D 3
 D 0x0020 0x000E 2
 <level>
 Image
+D 0x0018 0x0050 3 
+D 0x0018 0x1160 3 
 D 0x0020 0x0013 3
 D 0x0028 0x0010 3
 D 0x0028 0x0011 3