void DicomImageReader::getAttributes(const std::string filename,
- std::map <std::string , std::string> &infos,std::vector<std::string> i_attr)
+ std::map <std::string , std::string> &infos, std::vector<std::string> i_attr)
{
gdcm::Reader reader;
reader.SetFileName( filename.c_str() );
}
}
}
-
}
+
//=====================================================================
void DicomImageReader::ReadAttributes(const std::string& filename,
std::map<std::string,std::string>& attr)
namespace creaImageIO
{
+ typedef std::map<std::string, std::string> mapInfoDicom;
typedef struct
{
vtkImageData *img;
- std::map<std::string, std::string> infos;
+ //std::map<std::string, std::string> infos;
+ mapInfoDicom infos;
}OutStrGimmick;
virtual void GetSelectedFiles(std::vector<std::string>& s)
{ GimmickError("INTERNAL ERROR : GetSelectedFiles not implemented"); }
- virtual void GetImages(int dim, std::vector<std::string> files, std::vector<vtkImageData*>& s)
- { GimmickError("INTERNAL ERROR : GetImages not implemented"); }
+ virtual void GetImages(int dim, std::vector<std::string> files, std::vector<vtkImageData*>& s)
+ { GimmickError("INTERNAL ERROR : GetImages not implemented"); }
virtual void OnSelectionChange(const std::vector<tree::Node*>& s, bool isSelection, int selection, bool mProcess)
{ GimmickError("INTERNAL ERROR : OnSelectionChange not implemented"); }
}else {
std::sort( im.begin(), im.end() );
}
-
+
return spacing;
}
void setDB(const std::string i_db, const std::string i_table);
const std::string getTag();
-
+
private:
OutputModelParser *m_outparser;
{
// CTor
WxGimmickPanel::WxGimmickPanel(wxWindow *parent,
- wxWindowID id,
- const wxPoint& pos,
- const wxSize& size,
- const std::string i_namedescp ,
- const std::string i_namedb ,
- int threads)
+ wxWindowID id,
+ const wxPoint& pos,
+ const wxSize& size,
+ const std::string i_namedescp,
+ const std::string i_namedb,
+ int threads)
: wxPanel( parent,
- id,
- pos,
- size,
- wxRESIZE_BORDER |
- wxSYSTEM_MENU |
- wxCLOSE_BOX |
- wxMAXIMIZE_BOX |
- wxMINIMIZE_BOX |
- wxCAPTION
- ),
+ id,
+ pos,
+ size,
+ wxRESIZE_BORDER |
+ wxSYSTEM_MENU |
+ wxCLOSE_BOX |
+ wxMAXIMIZE_BOX |
+ wxMINIMIZE_BOX |
+ wxCAPTION
+ ),
//mGimmick(0),
mView(0)
{
wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
try {
-
- mGimmick = boost::shared_ptr<Gimmick>(new Gimmick());
- mGimmick->Initialize(i_namedescp,i_namedb);
- int min_dim = GIMMICK_2D_IMAGE_SELECTION;
- int max_dim = GIMMICK_3D_IMAGE_SELECTION;
- mView = new WxGimmickView(mGimmick,
+ mGimmick = boost::shared_ptr<Gimmick>(new Gimmick());
+ mGimmick->Initialize(i_namedescp,i_namedb);
+ int min_dim = GIMMICK_2D_IMAGE_SELECTION;
+ int max_dim = GIMMICK_3D_IMAGE_SELECTION;
+ mView = new WxGimmickView(mGimmick,
this,
-1,
wxDefaultPosition,
min_dim,
max_dim,
threads);
- mView->Initialize();
+ mView->Initialize();
// Connect the AddProgress callback
- mView->ConnectValidationObserver ( boost::bind( &WxGimmickPanel::OnSelectedImage , this, _1 ) );
+ mView->ConnectValidationObserver ( boost::bind( &WxGimmickPanel::OnSelectedImage , this, _1 ) );
}
catch (crea::Exception e)
{
///Callback method on a selection
void WxGimmickPanel::OnSelectedImage(bool t)
{
- mSendImageSignal(t);
+ mSendImageSignal(t);
}
void WxGimmickPanel::AddImagesToDB(std::string dir)
//====================================================================
void WxGimmickPanel::ConnectSendImageObserver(SendImageCallbackType callback)
{
- mSendImageSignal.connect(callback);
+ mSendImageSignal.connect(callback);
}
} // EO namespace creaImageIO
mView->getSelectedFiles(outG, i_attr, mult, outmodel);
}
-
-
void OnSelectedImage(bool t);
void AddImagesToDB(std::string dir);
/// 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,
- bool mult, const std::string out_model)
+ bool mult, const std::string out_model)
{
// First we select the files
- std::vector<std::string> files;
+ std::vector<std::string> files;
std::string db_name = crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()));
GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->GetSelectedAsString(files);
void WxGimmickView::OnTools(wxCommandEvent& event)
{
mViewer->StopPlayer();
-
+
wxDialog* dial = new wxDialog (this,-1,_T("Tools"),wxDefaultPosition, wxSize(550,350));
wxSizer* buttonsSizer = dial->CreateSeparatedButtonSizer(wxOK|wxCANCEL);
{
std::string inputDir = crea::wx2std(gimmickTools->getInputDir());
std::string outputDir = crea::wx2std(gimmickTools->getOutputDir());
-
+
bool addToDB = gimmickTools->getAddToDBCheckBoxValue();
if (inputDir.compare("")!=0 && outputDir.compare("")!=0)
b2d.Execute();
if (addToDB)
{
+ std::cout <<"after addToDB" << std::endl;
mProgressDialog = new wxProgressDialog(_T("Adding directory"),_T(""),1000,this,wxPD_ELAPSED_TIME |wxPD_CAN_ABORT );
+ std::cout <<"after new wxProgressDialog" << std::endl;
mCurrentDirectory = gimmickTools->getOutputDir();
+ std::cout <<"after gimmickTools->getOutputDir[" <<mCurrentDirectory << std::endl;
mGimmick->AddDir(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),outputDir,true);
+ std::cout <<"after mGimmick->AddDir" << std::endl;
mProgressDialog->Pulse(_T("Updating view..."));
-
+ std::cout <<"after mProgressDialog->Pulse" << std::endl;
UpdateTreeViewLevel(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),1);
+ std::cout <<"after UpdateTreeViewLevel" << std::endl;
delete mProgressDialog;
+ std::cout <<"after delete mProgressDialog" << std::endl;
DisplayAddSummary();
+ std::cout <<"after dDisplayAddSummary" << std::endl;
}
}
}
found=true;
}
}
-
return !found;
}
//================================================================
//================================================================
RemoveAlertDlg::RemoveAlertDlg(wxWindow *parent,
- wxString title,
- const wxSize& size)
+ wxString title,
+ const wxSize& size)
: wxDialog( parent,
wxID_ANY,
title,
//wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY,crea::std2wx(out),wxDefaultPosition, wxSize(500,20));
wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY,
_T("To reload deleted patient, you should synchronize your database before."),
- wxDefaultPosition, wxSize(500,20));
+ wxDefaultPosition, wxSize(650,20)); // 650 vs 500 ? // JPRx
mcheck = new wxCheckBox(this, 5478, _T("Do not display this warning again!"));
Connect( mcheck->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &RemoveAlertDlg::onCheck );
wxSizer* buttonsSizer = this->CreateSeparatedButtonSizer(wxOK|wxCANCEL);