From: Eduardo DAVILA Date: Tue, 26 Nov 2013 14:46:20 +0000 (+0100) Subject: 2188 creaImageIO Feature New Normal ImagesChooserDialog Box return DICOM tags maps X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=aa095c927358b5bd78f6145dfd06368dc065349c;p=creaImageIO.git 2188 creaImageIO Feature New Normal ImagesChooserDialog Box return DICOM tags maps --- diff --git a/bbtk/src/bbcreaImageIOImagesChooserDialogBox.xml b/bbtk/src/bbcreaImageIOImagesChooserDialogBox.xml index 9c07473..e240738 100644 --- a/bbtk/src/bbcreaImageIOImagesChooserDialogBox.xml +++ b/bbtk/src/bbcreaImageIOImagesChooserDialogBox.xml @@ -45,13 +45,33 @@ INPUTS/OUTPUTS DECLARATION --> + + +
-      typedef std::vector OutputImagesType;
+ typedef std::vector VectorStringType;
+ + +
+      typedef std::vector OutputImagesType;
+
+ + +
+      typedef std::map MapInfoDicom;
+
+ + +
+      typedef std::vector< MapInfoDicom > VectorMapInfoDicom;
+
+ + @@ -60,12 +80,12 @@
         creaImageIO::WxSimpleDlg dlg(0,crea::std2wx(bbGetInputTitle()),"localdatabase_Descriptor.dscp","Local Database"); 
 		dlg.ShowModal(); 
+                bbSetOutputDicomInfo( dlg.getDicomInfoImagesSelected() );
 		if (dlg.getImagesSelected().size()!=0){ 
 		  if(dlg.getImagesSelected().size() ==1)
 		  {
 			bbSetOutputOut( dlg.getImagesSelected()[0] );  
 		  } else {
-printf("EED  creaImageIOWxSimpleDlg 1 \n");
 			  // FCY: it will be a big problem if we have several kind of data in the same folder.
 			  // creation of a huge vtkImageData!!!!
 			  vtkImageData* first = dlg.getImagesSelected()[0];
@@ -101,11 +121,9 @@ printf("EED  creaImageIOWxSimpleDlg 1 \n");
 			  	// differents formats char , short, etc...
 			  	// differents components 1..3  ex. jpg ->RGB 3
 			  	imsize = imsize * first->GetScalarSize() * first->GetNumberOfScalarComponents();
-printf("EED  creaImageIOWxSimpleDlg 2 \n");
   		        	int slice,sizeImageVector=dlg.getImagesSelected().size();
                         	for (slice=0 ; sliceGetScalarPointer(0,0,slice), img->GetScalarPointer(0,0,0), imsize);
 				//img->Delete();
@@ -124,7 +142,6 @@ printf("EED  creaImageIOWxSimpleDlg 3 slice %d     sizeImageVector %d\n",slice,s
 // 			//	(*it)->Delete();
 //			//  }
 
-printf("EED  creaImageIOWxSimpleDlg 4 \n");
 			 	bbSetOutputOut(out);
 			} else {
 			 bbSetOutputOut(first);
diff --git a/src/creaImageIOVtkImageReader.cpp b/src/creaImageIOVtkImageReader.cpp
index 60ef13a..6cb4def 100644
--- a/src/creaImageIOVtkImageReader.cpp
+++ b/src/creaImageIOVtkImageReader.cpp
@@ -43,7 +43,7 @@ namespace creaImageIO{
   {
 	  
 	//EED 21 mars 2012  FLIP probleme  ..PLOP..
-	mReader->FileLowerLeftOn();
+	mReader->FileLowerLeftOff();
 	  
     if (name.size() == 0) 
       {
@@ -98,13 +98,56 @@ namespace creaImageIO{
     vtkImageData* im = 0;
     try
       {
-	
-	mReader->SetFileName(filename.c_str());
+	printf("EED VtkImageReader::ReadImage  Name:%s\n", GetName().c_str() );
+	mReader->SetFileName( filename.c_str() );
 	mReader->Update();
 	im = vtkImageData::New();
-        mReader->FileLowerLeftOff();
+
 	im->ShallowCopy(mReader->GetOutput());
-printf("EED VtkImageReader::ReadImage GetFileLowerLeft %d\n" , mReader->GetFileLowerLeft() );
+
+
+printf("EED ......\n"); 
+printf("EED ......\n");
+printf("EED VtkImageReader::ReadImage line 108   Missing FlipImage for JPEG, PNG, etc\n");
+printf("EED ......\n"); 
+printf("EED ......\n"); 
+/*
+        im=FlipImageY(im);          
+
+	if ( (GetName()=="JPEG") || (GetName()=="PNG") )
+	{
+
+		im->Update();
+		int inputdims[3];
+		im->GetDimensions (inputdims);
+
+                int nbScalComp	= im->GetNumberOfScalarComponents();
+		int scalarSize	= im->GetScalarSize();
+		int lineSize	= inputdims[0]*scalarSize*nbScalComp;	   
+		int planeSize	= inputdims[1]*lineSize;
+                int volumeSize  = inputdims[2]*planeSize;
+		char *pixelsIn	= (char *)im->GetScalarPointer();
+		char *pixelsOut = (char *)mImageOut->GetScalarPointer();
+	
+		char *lineIn;
+		char *lineOut;
+		char *debPlanIn;
+		char *debPlanOut;
+		int i,j,k;
+
+            	for(k=0; k out;
-			std::vector attr;
 				dlg.stopReading();
-				dlg.getSelected(out, attr,true,"");
+
+				std::vector outStrGimmick;
+				std::vector 		attrDicomTags;
+
+				   attrDicomTags.push_back("D0028_0010");
+				   attrDicomTags.push_back("D0008_0023");
+				   attrDicomTags.push_back("D0008_1070");
+				   attrDicomTags.push_back("D0019_100e");
+
+				dlg.getSelected(outStrGimmick, attrDicomTags,true,"");
+
 			m_results.clear();
-			int size=(int)out.size();
+			int size=(int)outStrGimmick.size();
 			int ii;
-			if(!bInfo)
-			{
+//			if(!bInfo)
+//			{
 				for (ii=0;iisecond.c_str() );
+					printf("EED WxSimpleDlg::OnReadGimmick D0008_0023 %s\n", outStrGimmick[ii].infos.find("D0008_0023")->second.c_str() );
+					printf("EED WxSimpleDlg::OnReadGimmick D0008_1070 %s\n", outStrGimmick[ii].infos.find("D0008_1070")->second.c_str() );
+					printf("EED WxSimpleDlg::OnReadGimmick D0019_100e %s\n", outStrGimmick[ii].infos.find("D0019_100e")->second.c_str() );
+					m_resultsDicomAtr.push_back( outStrGimmick[ii].infos );
 				}
-			}
-			else
-			{
-				for (ii=0;ii >  WxSimpleDlg::getDicomInfoImagesSelected()
+	{
+		return m_resultsDicomAtr;
+	}
+
 	  
 }
 
diff --git a/src/creaImageIOWxSimpleDlg.h b/src/creaImageIOWxSimpleDlg.h
index 7fd3335..8741258 100644
--- a/src/creaImageIOWxSimpleDlg.h
+++ b/src/creaImageIOWxSimpleDlg.h
@@ -58,9 +58,11 @@ namespace creaImageIO
 
 		   /// return a vtkImageData vector of selected images, if available
 		   std::vector getImagesSelected();
-		
 		   wxString getInfoImage();
 
+		   std::vector< std::map >  getDicomInfoImagesSelected();
+
+
 		   void setInfo(bool i_val){bInfo = i_val;}
 		   
 		   // OutStrGimmick:
@@ -69,19 +71,19 @@ namespace creaImageIO
 		   std::vector getMapInfos(){return m_resultsInfo;}
 
 	private:
-		bool 					bInfo;
-		std::string 				namedescp; 
-		std::string 				namedb;
-		wxString 				infoimage;
+		bool 							bInfo;
+		std::string 						namedescp; 
+		std::string 						namedb;
+		wxString 						infoimage;
 
 		/// interface to read data
-		SimpleView 				m_view;
+		SimpleView 						m_view;
 
 		/// vtkImageData vector
-		std::vector 		m_results;
+		std::vector 				m_results;
+		std::vector< std::map > 	m_resultsDicomAtr;
 
 		std::vector m_resultsInfo;
 		
-
 	};
 }