// but for all selected file.
// For the moment, no output model file (XML)
std::vector<creaImageIO::OutStrGimmick> out;
+ std::vector<std::string> outFileNames;
std::vector<std::string> attr;
attr.push_back("D0028_0010");
attr.push_back("D0008_0023");
attr.push_back("D0008_1070");
- w.getSelected(out, attr,true,"");
+ w.getSelected(out, attr,outFileNames,true,"");
std::cout<<out.size()<<std::endl;
crea::VtkBasicSlicer(out.front().img);
out.front().img->Delete();
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,"");
+ std::vector<std::string> outStrFileNames;
+ w.getSelected(outStrGimmick, bbGetInputDicomTags(), outStrFileNames ,true,"");
m_results.clear();
int size=(int)outStrGimmick.size();
int ii;
bbSetOutputOut(m_results[0]);
bbSetOutputOut2(m_results);
}
- std::vector<std::string> files;
- w.GetSelectedFiles(files);
- bbSetOutputFiles(files);
- bbSetOutputDicomInfo( m_resultsDicomAtr );
+//EED2024-06-21 w.GetSelectedFiles(files);
+// bbSetOutputFiles(files);
+
+ bbSetOutputFiles(outStrFileNames);
+
+ bbSetOutputDicomInfo( m_resultsDicomAtr );
w.OnExit();
}
bbSetInputImageMaxDimension(3);
bbSetInputImageOutputDimension(3);
bbSetInputTitle("Select image(s)");
- bbSetInputOutput(0);
- bbSetOutputOut(0);
+ bbSetInputOutput(NULL);
+ bbSetOutputOut(NULL);
</PRE></defaultValues>
for (it=im.begin(); it!=im.end(); ++it)
{
OutStrGimmick out;
- out.img = vtkImageData::New();
+ out.img = vtkImageData::New();
out.img->ShallowCopy(mReader.GetImage(*it));
- if(i_attr.mult)
+ if(i_attr.mult)
{
getAttributes((*it),out.infos,i_attr);
}
{
OutStrGimmick out;
vtkImageData* first = mReader.GetImage( im.front() );
- out.img = vtkImageData::New();
+ out.img = vtkImageData::New();
+
int ext[6];
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
for (int slice= 0 ; slice <dim[2]; slice++)
{
OutStrGimmick out;
- out.img = vtkImageData::New();
+ out.img = vtkImageData::New();
out.img->SetSpacing(spac);
int ext[6];
//EED 2017-01-01 Migration VTK7
FileList fileVector;
//GDCM_NAME_SPACE::File *f = GDCM_NAME_SPACE::File::New();
GDCM_NAME_SPACE::SerieHelper *sh = GDCM_NAME_SPACE::SerieHelper::New();
+ sh->SetDropDuplicatePositions(true);
std::vector<std::string> lstAux;
std::vector<std::string>::iterator it;
for (it=im.begin(); it!=im.end(); ++it)
}else {
std::sort( im.begin(), im.end() );
}
-
+
return spacing;
}
// i_attr: list of dicom tags to extract
// mult: information of one file or multiple files
// outmodel: xml-filename that specifies images order..(todo)
- void getSelected(std::vector<OutStrGimmick> &outG,std::vector< std::string> i_attr, bool mult, const std::string outmodel)
+ void getSelected(std::vector<OutStrGimmick> &outG,std::vector< std::string> i_attr, std::vector<std::string> &outFileNames, bool mult, const std::string outmodel)
{
- mView->getSelectedFiles(outG, i_attr, mult, outmodel);
+ mView->getSelectedFiles(outG, i_attr, outFileNames, mult, outmodel);
}
void OnSelectedImage(bool t);
}
mtopsizer->Add( mView,1,wxGROW,0);
wxSizer* bsizer = this->CreateSeparatedButtonSizer(wxOK|wxCANCEL);
- //mOkButton = new wxButton(this, wxID_OK, _T("OK"), wxPoint(170,50));
+ //mOkButton = new wxButton(this, wxID_OK, _T("OK"), wxPoint(170,50));
//mCancelButton = new wxButton(this, wxID_CANCEL, _T("CANCEL"), wxPoint(210,50));
- mOkButton = (wxButton*)FindWindowById(GetAffirmativeId(), this);
- mCancelButton = (wxButton*)FindWindowById(GetEscapeId(), this);
+ mOkButton = (wxButton*)FindWindowById(GetAffirmativeId(), this);
+ mCancelButton = (wxButton*)FindWindowById(GetEscapeId(), this);
mOkButton->Enable(false);
mtopsizer->Add ( bsizer, 0, wxGROW );
SetSizer( mtopsizer );
-
Layout();
}
// i_attr: list of dicom tags to extract
// mult: information of one file or multiple files
// outmodel: xml-filename that specifies images order..(todo)
- void getSelected(std::vector<OutStrGimmick> &outG,std::vector< std::string> i_attr, bool mult, const std::string outmodel)
+ void getSelected(std::vector<OutStrGimmick> &outG,std::vector< std::string> i_attr, std::vector<std::string> &outFileNames, bool mult, const std::string outmodel)
{
- mView->getSelectedFiles(outG, i_attr, mult, outmodel);
+ mView->getSelectedFiles(outG, i_attr, outFileNames, mult, outmodel);
}
void GetSelectedFiles(std::vector<std::string>& s)
/// By default if out_infos is empty, we dont' provide informations, we return only vtkImageData
/// if out_infos has only one entry "all" we provide all database informations
- void WxGimmickView::getSelectedFiles(std::vector<OutStrGimmick> &outG, std::vector< std::string> i_attr,
+ void WxGimmickView::getSelectedFiles(std::vector<OutStrGimmick> &outG, std::vector< std::string> i_attr, std::vector<std::string> &outFileNames,
bool mult, const std::string out_model)
{
// First we select the files
}
// Now we read and create the waiting output (vtkImageData * or OutGimmickData *)
readImages(outG, sort_files, Oattr, i_dim_out, zspacing);
-
+ outFileNames = sort_files;
}
void GetSelectedFiles(std::vector<std::string>& s);
/// Returns the selected files in output structure
- void getSelectedFiles(std::vector<OutStrGimmick> &outG, std::vector< std::string> out_infos, bool mult = false, const std::string out_model = "");
+ void getSelectedFiles(std::vector<OutStrGimmick> &outG, std::vector< std::string> out_infos, std::vector<std::string> &outFileNames, bool mult = false, const std::string out_model = "");
/// Returns the selected Images so that they comply with the
/// given parameter(4D) (overloaded from GimmickView)
{
dlg.stopReading();
std::vector<creaImageIO::OutStrGimmick> outStrGimmick;
- dlg.getSelected(outStrGimmick, m_attrDicomTags,true,"");
+ std::vector<std::string> outFileNames;
+ dlg.getSelected(outStrGimmick, m_attrDicomTags, outFileNames,true,"");
m_results.clear();
int size=(int)outStrGimmick.size();
int ii;