From: Eduardo DAVILA Date: Mon, 17 Jun 2019 10:40:22 +0000 (+0200) Subject: #3264 creaImageIO Feature New Normal - Add Dicom Tags to the DB sqlite X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=2db01242beca78a1ba142206668c50e59531fe47;p=creaImageIO.git #3264 creaImageIO Feature New Normal - Add Dicom Tags to the DB sqlite --- diff --git a/bbtk/src/bbcreaImageIOImagesChooserDialogBox.xml b/bbtk/src/bbcreaImageIOImagesChooserDialogBox.xml index 96c25dd..7463747 100644 --- a/bbtk/src/bbcreaImageIOImagesChooserDialogBox.xml +++ b/bbtk/src/bbcreaImageIOImagesChooserDialogBox.xml @@ -79,6 +79,9 @@
+
+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");
 	
+
     
diff --git a/src/creaImageIODicomImageReader.cpp b/src/creaImageIODicomImageReader.cpp index 7f608f0..d97634a 100644 --- a/src/creaImageIODicomImageReader.cpp +++ b/src/creaImageIODicomImageReader.cpp @@ -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; } diff --git a/src/creaImageIOGimmickView.cpp b/src/creaImageIOGimmickView.cpp index 47aa9cb..2ff7855 100644 --- a/src/creaImageIOGimmickView.cpp +++ b/src/creaImageIOGimmickView.cpp @@ -464,8 +464,10 @@ void GimmickView::ReadImagesNotThreaded(std::vector& 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& s, std::vect else { } +printf("EED GimmickView::isSingle end\n"); + return bres; } diff --git a/src/creaImageIOImageReader.cpp b/src/creaImageIOImageReader.cpp index c3b9070..ecba3ed 100644 --- a/src/creaImageIOImageReader.cpp +++ b/src/creaImageIOImageReader.cpp @@ -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; } //===================================================================== diff --git a/src/creaImageIOMultiThreadImageReader.cpp b/src/creaImageIOMultiThreadImageReader.cpp index d0103d7..d0bea26 100644 --- a/src/creaImageIOMultiThreadImageReader.cpp +++ b/src/creaImageIOMultiThreadImageReader.cpp @@ -372,9 +372,9 @@ namespace creaImageIO //===================================================================== vtkImageData* MultiThreadImageReader::GetImage(const std::string& filename) { - // Start(); - // std::cout << "** MultiThreadImageReader::GetImage('"<(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 diff --git a/src/creaImageIOWxGimmickView.cpp b/src/creaImageIOWxGimmickView.cpp index c4b2edb..63d4f42 100644 --- a/src/creaImageIOWxGimmickView.cpp +++ b/src/creaImageIOWxGimmickView.cpp @@ -351,18 +351,28 @@ namespace creaImageIO void WxGimmickView::getSelectedFiles(std::vector &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 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"); + } diff --git a/src/data/localdatabase_Descriptor.dscp b/src/data/localdatabase_Descriptor.dscp index 402931b..63cc516 100644 --- a/src/data/localdatabase_Descriptor.dscp +++ b/src/data/localdatabase_Descriptor.dscp @@ -30,6 +30,8 @@ D 0x0020 0x000D 3 D 0x0020 0x000E 2 Image +D 0x0018 0x0050 3 +D 0x0018 0x1160 3 D 0x0020 0x0013 3 D 0x0028 0x0010 3 D 0x0028 0x0011 3