//=====
void GetDicomAttributesFromMaps::Process()
{
-
// THE MAIN PROCESSING METHOD BODY
// Here we simply set the input 'In' value to the output 'Out'
// And print out the output value
std::vector< std::string > lstResult;
std::map <std::string,std::string> tmpMap;
int i,size=bbGetInputIn().size();
- std::string strElement;
+
+// The MAP.find() function is not working in all the cases
for (i=0;i<size;i++)
{
tmpMap = bbGetInputIn()[i];
- strElement = tmpMap.find( bbGetInputKeyDicom() )->second;
- lstResult.push_back( strElement );
+ std::map<std::string, std::string>::iterator it;
+ for ( it = tmpMap.begin(); it != tmpMap.end(); it++ )
+ {
+ if (it->first==bbGetInputKeyDicom())
+ {
+ lstResult.push_back( it->second );
+ } // if it->first
+ }//for it
} // for i
bbSetOutputOut( lstResult );
-
}
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
<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> VectorStringType;</PRE>
+ </typedef>
+ <input name="DicomTags" type="VectorStringType" description="Dicom Tags (vector of Dicom tags ex: D0028_0030 D0020_0037)"/>
+
+
+ <typedef>
+ <PRE>
+ typedef std::map<std::string, std::string> MapInfoDicom;</PRE>
+ </typedef>
+
+ <typedef>
+ <PRE>
+ typedef std::vector< MapInfoDicom > VectorMapInfoDicom;</PRE>
+ </typedef>
+ <output name="DicomInfo" type="VectorMapInfoDicom" description="vector of maps of Dicom tags"/>
+
+
<typedef><PRE>typedef std::vector<std::string> OutputFilesType; </PRE></typedef>
<typedef><PRE>typedef std::vector<vtkImageData*> OutputImagesType;</PRE></typedef>
bbGetInputImageOutputDimension(),
threads);
w.ShowModal();
-
+/*
if (w.GetReturnCode() == wxID_OK)
{
if (bbGetInputOutput()==0)
// bbSetOutputOut(0);
// }
}
+*/
+
+
+
+ /// vtkImageData vector
+ std::vector<vtkImageData*> m_results;
+ std::vector< std::map<std::string,std::string> > m_resultsDicomAtr;
+
+
+ if (w.GetReturnCode() == wxID_OK)
+ {
+ w.stopReading();
+ std::vector<creaImageIO::OutStrGimmick> outStrGimmick;
+ w.getSelected(outStrGimmick, bbGetInputDicomTags() ,true,"");
+ m_results.clear();
+ int size=(int)outStrGimmick.size();
+ int ii;
+// if(!bInfo)
+// {
+ for (ii=0;ii<size;ii++)
+ {
+ outStrGimmick[ii].img->Modified();
+ outStrGimmick[ii].img->Update();
+ m_results.push_back(outStrGimmick[ii].img);
+ m_resultsDicomAtr.push_back( outStrGimmick[ii].infos );
+ }
+// } else {
+// for (ii=0;ii<size;ii++)
+// {
+// m_resultsInfo.push_back(outStrGimmick[ii]);
+// }
+// }
+
+// infoimage = _T("EED Missing info <void> ???");
+// infoimageSource = _T("GIMMICK");
+
+ if (bbGetInputOutput()==0)
+ {
+// std::vector<vtkImageData*> images;
+// w.GetSelectedImages(images,bbGetInputImageOutputDimension());
+ bbSetOutputOut(m_results[0]);
+ bbSetOutputOut2(m_results);
+ }
+ std::vector<std::string> files;
+ w.GetSelectedFiles(files);
+ bbSetOutputFiles(files);
+
+
+ bbSetOutputDicomInfo( m_resultsDicomAtr );
+
+
+
+ w.OnExit();
+ }
+
+
+
+
</PRE></process>
<process>
<PRE>
creaImageIO::WxSimpleDlg dlg(0,crea::std2wx(bbGetInputTitle()),"localdatabase_Descriptor.dscp","Local Database");
- dlg.SetAttrDicomTags( bbGetInputDicomTags() );
- dlg.ShowModal();
- bbSetOutputDicomInfo( dlg.getDicomInfoImagesSelected() );
- if (dlg.getImagesSelected().size()!=0)
- {
- bbSetOutputFileName( std::string( dlg.getInfoImage().mb_str() ) );
- bbSetOutputOut( dlg.getVolumeSelected() );
-
- } else {
- bbSetOutputOut( NULL );
- } // if dlg.getImagesSelected().size()!=0
+ dlg.SetAttrDicomTags( bbGetInputDicomTags() );
+ dlg.ShowModal();
+ bbSetOutputDicomInfo( dlg.getDicomInfoImagesSelected() );
+ if (dlg.getImagesSelected().size()!=0)
+ {
+ bbSetOutputFileName( std::string( dlg.getInfoImage().mb_str() ) );
+ bbSetOutputOut( dlg.getVolumeSelected() );
+ } else {
+ bbSetOutputOut( NULL );
+ } // if dlg.getImagesSelected().size()!=0
bbSetOutputOutImages( dlg.getImagesSelected());
bbSignalOutputModification( );
-
</PRE>
</process>
{
if( mImageAdder.isAttributeExist((*it)) != "" ) // in DB
{
+printf("EED Gimmick::fillVectInfos inside %s\n",(*it).c_str());
infos.inside.push_back((*it));
}
else
{
infos.outside.push_back((*it)); // Need to scan again the files
+printf("EED Gimmick::fillVectInfos outside %s\n",(*it).c_str());
}
}
}
return mess.str();
}
-}
\ No newline at end of file
+}
void SQLiteTreeHandler::getAllAttributes(std::string i_filename, std::map<std::string, std::string> &i_results)
{
int level=GetTree().GetNumberOfLevels()-1;
-
+
std::string search = i_filename;
std::string param = "FullFileName";
std::string name;
std::vector<std::string> values;
std::vector<std::string>::iterator it_val;
-
-
-
- while(level>1)
+ while(level>=1)
{
- attr = GetTree().GetAttributeDescriptorList(level,1);
+ attr = GetTree().GetAttributeDescriptorList(level,1);
- name = GetTree().GetLevelDescriptor(level).GetName();
- std::vector<std::string> values;
- GetUpLevelNodeId(level, param,search,id);
- GetAttributes(name, param,search,attr, values);
- for(it_attr = attr.begin(), it_val = values.begin(); it_attr != attr.end(); it_attr++, it_val++)
- {
- i_results[(*it_attr).GetKey()] = (*it_val).c_str();
- }
- search = id;
- param = "ID";
- level --;
- }
+ name = GetTree().GetLevelDescriptor(level).GetName();
+ std::vector<std::string> values;
+
+//EED 2018-04-13 GetUpLevelNodeId(level, param,search,id);
+ if (level>1)
+ {
+ GetUpLevelNodeId(level, param,search,id);
+ }
+ GetAttributes(name, param,search,attr, values);
+ for(it_attr = attr.begin(), it_val = values.begin(); it_attr != attr.end(); it_attr++, it_val++)
+ {
+ i_results[(*it_attr).GetKey()] = (*it_val).c_str();
+ } // for
+ search = id;
+ param = "ID";
+ level --;
+ } // while level
}
q.nextRow();
}
parent_id = results.str();
-
}
private :
boost::shared_ptr<Gimmick> mGimmick;
- WxGimmickView* mView;
+ WxGimmickView *mView;
- wxButton* mOkButton;
- wxButton* mCancelButton;
- wxBoxSizer *mtopsizer;
+ wxButton *mOkButton;
+ wxButton *mCancelButton;
+ wxBoxSizer *mtopsizer;
enum
{
WxGimmickReaderDialog dlg(0,-1,
namedescp,
namedb,
- _T("Select image(s) - Gimmick! (c) CREATIS-LRMN 2008"),
+ _T("Select image(s) - Gimmick! (c)"),
wxDefaultPosition,
wxSize(810,750),
GIMMICK_2D_IMAGE_SELECTION,
D 0x0020 0x4000 3
#D 0x0004 0x1500 4
#D 0x0004 0x1501 4
-#D 0x0028 0x1052 3
-#D 0x0028 0x1053 3
+D 0x0028 0x1052 3
+D 0x0028 0x1053 3
#D 0x0050 0x0004 3
#D 0x0020 0x0052 3
#D 0x0008 0x0016 3