Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | Friends

creaImageIO::WxGimmickView Class Reference
[View]

Concrete derivative of GimmickView which implements a wxWidgets-based view. More...

#include <creaImageIOWxGimmickView.h>

Inheritance diagram for creaImageIO::WxGimmickView:
Inheritance graph
[legend]
Collaboration diagram for creaImageIO::WxGimmickView:
Collaboration graph
[legend]

List of all members.

Public Types

typedef int EventType
typedef std::map< std::string,
TreeView * > 
TreeViewMapType
typedef boost::signal< void(bool)> ValidationSignalType
typedef
ValidationSignalType::slot_function_type 
ValidationCallbackType
typedef std::vector
< DicomDatabase * > 
DicomDatabaseListType
 Type of list of DicomDatabase.

Public Member Functions

 WxGimmickView (boost::shared_ptr< Gimmick >, wxWindow *parent, const wxWindowID id, const wxPoint &pos, const wxSize &size, int min_dim=2, int max_dim=3, int number_of_threads=0)
 Ctor.
virtual ~WxGimmickView ()
 Virtual destructor.
void GetSelectedFiles (std::vector< std::string > &s)
void getSelectedFiles (std::vector< OutStrGimmick > &outG, std::vector< std::string > out_infos, bool mult=false, const std::string out_model="")
 Returns the selected files in output structure.
void GetSelectedImages (std::vector< vtkImageData * > &s, int dim)
void GetSelectedImagesInVector (std::vector< vtkImageData * > &s, int dim)
 Adds the selected Images to the given vector.
void GetImages (int dim, const std::vector< std::string > &files, std::vector< vtkImageData * > &s)
void OnSelectionChange (const std::vector< tree::Node * > &s, bool isSelection, int selection, bool mProcess)
 Callback called when a selection from a TreeView has changed.
void StopPlayer ()
 Stops the player.
void AddIgnoreFile (tree::Node *toRemove)
 Adds a file to ignore.
void ClearSelection ()
 Resets the default image.
void CopyFiles (const std::vector< std::string > &filenames)
 Copies selected files.
void AddDir (std::string dirName)
 Add selected files to the Database.
void ReadImageThreaded (const std::vector< tree::Node * > &sel)
 Sends a request to read the currently selected node and the ones that surround it.
void OnSaveSettingsCallback (const std::string &copyPath, const std::string &dbPath, const std::string &syncEvent, const std::string &syncFreq)
 Saves the settings to the file.
void OnListenerCallback (const std::string &drive, bool addFiles, bool removeFiles)
 Changes listener state.
void OnDriveMount (bool mount)
 Acts upon a drive mount.
void StartListeningThread ()
 Starts the listening thread on the CD/DVD drive.
void StopListeningThread ()
 Stops the listening thread on the CD/DVD drive.
void OnFieldsEdited (tree::Node *node, const std::string &name, const std::string &key, const std::string &val)
 Called upon when a field has been edited.
void GetVisibleAttributes (std::vector< std::string > &shown, std::vector< std::string > &nShown, int level)
 Called upon to return the visible attributes of the current tab.
void OnAttributesChanged (const std::vector< std::string > &nShown, int level)
 Called when there has been a change in the visible attributes of a tree view.
virtual void Initialize ()
TreeViewMapTypeGetTreeViewMap ()
 Returns the TreeViewMap (ref).
const TreeViewMapTypeGetTreeViewMap () const
 Returns the TreeViewMap (const ref).
virtual void Finalize ()
 Finalize.
int GetMaximalPriority ()
 Returns the maximal priority.
virtual void GetSelectedImages (std::vector< vtkImageData * > &)
 Returns the vector of images corresponding to selection.
virtual void GetImages (int dim, std::vector< std::string > files, std::vector< vtkImageData * > &s)
virtual void Anonymize (std::vector< std::string > i_filenames, int type)
 Anonymize or de-anonymize data.
virtual void SaveAs (const std::vector< std::string > &filenames)
 Copies selected files.
bool NoValidateSelected ()
 No selected image.
bool ValidateSelected (tree::Node *sel, int min_dim, int max_dim)
 Validates the dimension compliance of the images with the maximum and minimum given, and between their sizes.
void ReadImagesNotThreaded (std::vector< vtkImageData * > &s, std::vector< std::string > files, int dim)
 Reads the vector of images, builds it in the dimension required and returns them in the supplied vector.
void ReadImagesNotThreadedInVector (std::vector< vtkImageData * > &s, std::vector< std::string > files, int dim)
 Reads the vector of images, builds it in the dimension required and returns them in the supplied vector.
void RequestReading (tree::Node *n, int prio, int selection_index, boost::shared_ptr< ImagePointerHolder > p)
 current selection (-1 if not in selection)
std::string GetMessage ()
 Obtains the message of the state.
void SetMessage (std::string mess)
 Obtains the message of the state.
void ResetExtent ()
 Resets the data of the extent and begins a new selection.
void CreateTreeViews ()
 Create the tree views.
void CreateSingleTreeView (std::string &i_name)
 Create a tree view with a given name.
virtual void UpdateTreeViewLevel (const std::string &, int l)
void OnMultiThreadImageReaderEvent (const std::string &filename, MultiThreadImageReaderUser::EventType t, vtkImageData *image)
vtkImageData * GetDefaultImage ()
void ConnectValidationObserver (ValidationCallbackType callback)
void modifyValidationSignal (bool ivalid)
void readImages (std::vector< OutStrGimmick > &o_output, std::vector< std::string > im, OutputAttr i_attr, int i_dim, double i_zspc)
bool isSingle (const std::string i_file)
void stopReader ()
virtual int GetSelectionSize ()
 Returns the size of the current selection.
virtual bool IsSelectionValid ()
 Returns true if there is a valid selection.
virtual void GetSelectedDicomNodes (std::vector< DicomNode * > &)
 Returns the vector of DicomNode corresponding to selection.
virtual DicomNode * GetDicomNodeOfItem (const TreeItemId &i)
 Returns the DicomNode corresponding to the tree item.
virtual DicomDatabaseListTypeGetDicomDatabaseList ()
 Returns the list of DicomDatabase open.
virtual const
DicomDatabaseListType
GetDicomDatabaseList () const
 Returns the list of DicomDatabase open (const).
virtual void LoadOrCreateFavoritesDatabase ()
 Loads or creates a favorites database.
void MultiThreadImageReaderEventLock ()
void MultiThreadImageReaderEventLock ()
void MultiThreadImageReaderEventUnlock ()
void MultiThreadImageReaderEventUnlock ()
wxMutex & GetMultiThreadImageReaderUserMutex ()
QMutex * GetMultiThreadImageReaderUserMutex ()

Public Attributes

OutStrGimmick m_out

Protected Member Functions

void CreateToolBar ()
 Creates the tool bar.
void CreateTreeView (TreeHandler *)
 Create the tree view for TreeHandler provided.
virtual void OpenOrNewDatabase (bool open)
 Opens an existing database, or else, creates a local database.
virtual void ShowHelp ()
 Shows the help.
virtual void RebuildView ()
virtual void UpdateDicomDatabaseView (DicomDatabase *)
virtual void UpdateDicomNodeView (DicomNode *n, const TreeItemId &parent)

Private Member Functions

void CreateIconList ()
void OnAddFiles (wxCommandEvent &event)
 Callback for adding files.
void OnAddDir (wxCommandEvent &event)
 Callback for adding dir.
void OnRemove (wxCommandEvent &event)
 Callback for removing files.
void OnSynchronize (wxCommandEvent &event)
 Callback for synchronization.
void OnSettings (wxCommandEvent &event)
 Callback for settings edition.
void OnTools (wxCommandEvent &event)
 Callback for settings edition.
void OnImportExport (wxCommandEvent &event)
 Callback for Import/Export images.
void ImportImages ()
void ExportImages ()
void CreateSettingsDialog (wxNotebook *nb, wxDialog *dial)
 Creates the settings dialog (the pages inside and the information).
void DisplayAddSummary ()
 Display a message box with the last addition statistics.
bool isNeedRecursive (std::string i_name)
 Test a directory to know if contains sub-directory to analyze.
int NumberFilesToAdd (const std::string &dirpath, bool recursive)
 Determines number of files potentially to add to database.
void OnAddProgress (Gimmick::AddProgress &)
 AddProgress Gimmick callback.
void UpdateWindowUI (long flags=wxUPDATE_UI_NONE)
void OnAddDB (wxCommandEvent &event)
 callback to add a database
void OnCreateDB (wxCommandEvent &event)
 Create a DB from an Attributes Descriptor files.
std::string ExtractName (const std::string &i_name)
void CreateEditFieldsDialog (tree::Node *node, std::vector< std::string > names, std::vector< std::string > keys)
 Edits the fields of a given node.
void DumpTags (const std::string i_filename)
 Display all Dicom Tags.
void ExportToStorage (const std::vector< std::string > i_filenames)
 Export from Storage to Storage.
void killProgress ()

Private Attributes

wxBoxSizer * mbottom_sizer
wxBoxSizer * msizer
bool mConstructed
wxToolBar * mToolBar
 The ToolBar and the tools.
wxToolBarToolBase * mToolAddFile
wxToolBarToolBase * mToolAddDir
wxToolBarToolBase * mToolRemove
wxToolBarToolBase * mToolAddDatabase
wxToolBarToolBase * mToolHelp
wxToolBarToolBase * mToolSynchronize
wxToolBarToolBase * mToolSettings
wxToolBarToolBase * mToolTools
wxSplitterWindow * mSplitter
wxPanel * mBottomPanel
wxStaticText * mText
wxNotebook * mNotebook
wxImageList * mIcon
 The list of icons.
boost::shared_ptr< GimmickmGimmick
 Controller which manages the interaction with the model.
ListenermListener
time_t mstart
wxProgressDialog * mProgressDialog
 Progress dialog.
int mSelectionMaxDimension
 The selection's maximum dimension.
int mSelectionMinDimension
 The selection's minimum dimension.
WxViewermViewer
 Image previewer.
tree::NodemCurImageItemToShow
 Currently Displayed Node.
std::vector< boost::shared_ptr
< ImagePointerHolder > > 
pointers
wxString mCurrentDirectory

Friends

class ThreadedImageReader
class MultiThreadImageReader

Detailed Description

Concrete derivative of GimmickView which implements a wxWidgets-based view.

Definition at line 31 of file creaImageIOWxGimmickView.h.


Member Typedef Documentation

typedef std::vector<DicomDatabase*> creaImageIO::GimmickView::DicomDatabaseListType [inherited]

Type of list of DicomDatabase.

Definition at line 37 of file OldcreaImageIOGimmickView.h.

Reimplemented from creaImageIO::MultiThreadImageReaderUser.

Definition at line 35 of file creaImageIOWxGimmickView.h.

typedef std::map<std::string, TreeView*> creaImageIO::GimmickView::TreeViewMapType [inherited]

Type of map from View name to TreeView* (This map is equivalent for Views of the TreeHandlerMap of Gimmick)

Definition at line 68 of file creaImageIOGimmickView.h.

typedef ValidationSignalType::slot_function_type creaImageIO::GimmickView::ValidationCallbackType [inherited]

Definition at line 179 of file creaImageIOGimmickView.h.

typedef boost::signal<void (bool)> creaImageIO::GimmickView::ValidationSignalType [inherited]

Definition at line 178 of file creaImageIOGimmickView.h.


Constructor & Destructor Documentation

creaImageIO::WxGimmickView::WxGimmickView ( boost::shared_ptr< Gimmick gimmick,
wxWindow *  parent,
const wxWindowID  id,
const wxPoint &  pos,
const wxSize &  size,
int  min_dim = 2,
int  max_dim = 3,
int  number_of_threads = 0 
)

Ctor.

Definition at line 82 of file creaImageIOWxGimmickView.cpp.

References CreateIconList(), CreateToolBar(), creaImageIO::GimmickView::CreateTreeViews(), creaImageIO::GimmickView::GetDefaultImage(), GimmickDebugMessage, mbottom_sizer, mBottomPanel, mCurrentDirectory, mGimmick, mNotebook, mSelectionMaxDimension, mSelectionMinDimension, msizer, mSplitter, mText, mToolBar, mViewer, OnAddProgress(), pointers, creaImageIO::WxViewer::SetImageVector(), and creaImageIO::WxViewer::StartPlayer().

                          { Icon_Database,  
                            Icon_Patient,
                            Icon_Study,
                            Icon_Series,
                            Icon_Image };
  */
  //================================================================


  //======================================================================
  // CTor
        WxGimmickView::WxGimmickView(boost::shared_ptr<Gimmick> gimmick,
                               wxWindow *parent, 
                               const wxWindowID id,
                               const wxPoint& pos, 
                               const wxSize& size,
                               int min_dim,
                               int max_dim,
                               int number_of_threads)
    : wxPanel(parent,id,pos,size),
      GimmickView(gimmick, number_of_threads),
      mProgressDialog(0),
      mConstructed(false)
  {
    GimmickDebugMessage(1,"WxGimmickView::WxGimmickView"
                        <<std::endl);
    // Sets the current directory to the home dir
    mCurrentDirectory =  std2wx(gimmick->GetHomeDirectory());


     // Connect the AddProgress callback
    gimmick->ConnectAddProgressObserver 
     ( boost::bind( &WxGimmickView::OnAddProgress , this, _1 ) );

    // Create the list of icons (mIcon)
    CreateIconList();

    // Global sizer
    msizer = new wxBoxSizer(wxVERTICAL);

    // Create the tool bar
    CreateToolBar(); 
    msizer->Add( mToolBar, 0, wxGROW, 0);

    // Split part below toolbar into notebook for views and panel
    // for preview, messages...
    mSplitter = new wxSplitterWindow( this , -1);

    // Notebook
    mNotebook = new wxNotebook(mSplitter,
                               -1, wxDefaultPosition, wxDefaultSize, 0);

    //Gimmick
    mGimmick=gimmick;

    mSelectionMaxDimension = max_dim;
    mSelectionMinDimension = min_dim;
    
    // Create the views
    CreateTreeViews();

    // Bottom panel 
    mBottomPanel = new wxPanel(mSplitter,-1);
    
    mbottom_sizer = new wxBoxSizer(wxVERTICAL); //HORIZONTAL);
    
    
    // Previewer
    mViewer = new WxViewer(mBottomPanel, wxID_ANY, wxT("Gimmick! Viewer"),wxDefaultPosition, wxDefaultSize );
        //pointers.push_back(new ImagePointerHolder(GetDefaultImage())
        pointers.push_back(boost::shared_ptr<creaImageIO::ImagePointerHolder>(new ImagePointerHolder(GetDefaultImage())));

        mViewer->SetImageVector(pointers);
        mViewer->StartPlayer();


    mbottom_sizer->Add(mViewer,1,wxGROW,1);
    //    mViewer->Show();

    mText = new wxStaticText(mBottomPanel, wxID_ANY, wxT("Welcome to Gimmick!"));
    mbottom_sizer->Add(mText,0,wxGROW,0);

          
          
    mBottomPanel->SetSizer(mbottom_sizer);

    // Splitting
    int hsize = size.GetHeight();

    int top_minsize = 450;
    int bottom_minsize = 50;

    mSplitter->SetMinimumPaneSize( bottom_minsize );
    mSplitter->SplitHorizontally( mNotebook, mBottomPanel, 

Here is the call graph for this function:

creaImageIO::WxGimmickView::~WxGimmickView (  )  [virtual]

Virtual destructor.

Destructor.

Definition at line 185 of file creaImageIOWxGimmickView.cpp.


Member Function Documentation

void creaImageIO::WxGimmickView::AddDir ( std::string  dirName  ) 

Add selected files to the Database.

Definition at line 816 of file creaImageIOWxGimmickView.cpp.

References mGimmick, and mNotebook.

Referenced by creaImageIO::WxGimmickPanel::AddImagesToDB().

  {
     mGimmick->RemoveFile(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),toRemove);
   //  GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->UpdateLevel(1);
  }

  //=================================================
  void WxGimmickView::CopyFiles(const std::vector<std::string>& filenames)
  {
     mGimmick->CopyFiles(filenames, crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())));
     wxMessageBox(std2wx("The selected files have been copied"),_T("Copy files"),wxOK,this);
  }

   //=================================================

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::AddIgnoreFile ( tree::Node toRemove  )  [virtual]

Adds a file to ignore.

Reimplemented from creaImageIO::GimmickView.

Definition at line 802 of file creaImageIOWxGimmickView.cpp.

  {
        //TODO Select current tree handler       

virtual void creaImageIO::GimmickView::Anonymize ( std::vector< std::string >  i_filenames,
int  type 
) [inline, virtual, inherited]

Anonymize or de-anonymize data.

Definition at line 115 of file creaImageIOGimmickView.h.

References GimmickError.

          { GimmickError("INTERNAL ERROR : Anonymize not implemented"); }

void creaImageIO::WxGimmickView::ClearSelection (  )  [virtual]

Resets the default image.

Reimplemented from creaImageIO::GimmickView.

Definition at line 775 of file creaImageIOWxGimmickView.cpp.

References mViewer, and creaImageIO::WxViewer::RefreshIfNecessary().

     {
        mViewer->RefreshIfNecessary();
     }
  }
#else
  void WxGimmickView::UpdateWindowUI(long flags)
  {
          if(mViewer)
     {

Here is the call graph for this function:

void creaImageIO::GimmickView::ConnectValidationObserver ( ValidationCallbackType  callback  )  [inherited]

Adds the function f to the list of functions to call when the addition progresses. f is of type ProgressCallbackType which is: void (*ProgressCallbackType)(Progress&) To pass a member function 'f' of an instance 'c' of a class 'C' as callback you have to 'bind' it, i.e. call: ConnectValidationObserver ( boost::bind( &C::f , c, _1 ) );

Definition at line 827 of file creaImageIOGimmickView.cpp.

References creaImageIO::GimmickView::mValidationSignal.

Referenced by creaImageIO::WxGimmickPanel::WxGimmickPanel(), and creaImageIO::WxGimmickReaderDialog::WxGimmickReaderDialog().

  {
    mValidationSignal.connect(callback);
  }       

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::CopyFiles ( const std::vector< std::string > &  filenames  )  [virtual]

Copies selected files.

Reimplemented from creaImageIO::GimmickView.

Definition at line 809 of file creaImageIOWxGimmickView.cpp.

void creaImageIO::WxGimmickView::CreateEditFieldsDialog ( tree::Node node,
std::vector< std::string >  names,
std::vector< std::string >  keys 
) [private, virtual]

Edits the fields of a given node.

Reimplemented from creaImageIO::GimmickView.

Definition at line 1130 of file creaImageIOWxGimmickView.cpp.

References mListener.

  {
          mListener->Resume();
  }

   //========================================================================

void creaImageIO::WxGimmickView::CreateIconList (  )  [private]

Definition at line 417 of file creaImageIOWxGimmickView.cpp.

References creaImageIO::GimmickView::GetTreeViewMap(), and mNotebook.

Referenced by WxGimmickView().

  {
        GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->GetSelectedAsString(s);
  }
  //======================================================================

  //======================================================================
  void WxGimmickView::GetImages(int dim, 
                                const std::vector<std::string>& files, 
                                std::vector<vtkImageData*>& s)
  {
        ReadImagesNotThreaded(s,files,dim);
  }
  //======================================================================


  //=================================================
  void WxGimmickView::CreateIconList()
  {
    // Size of the icons;
    int size = 16;

    wxIcon icons[20];
    // should correspond to Icon_xxx enum
    icons[Icon_accept]          = wxIcon(accept_xpm);
    icons[Icon_add]             = wxIcon(add_xpm);
    icons[Icon_folder_down]     = wxIcon(folder_down_xpm);
    icons[Icon_page_down]       = wxIcon(page_down_xpm);
    icons[Icon_remove]          = wxIcon(remove_xpm);
    icons[Icon_database_add]    = wxIcon(database_add_xpm);
    icons[Icon_help]            = wxIcon(help_xpm);
    icons[Icon_synchronize]     = wxIcon(synchronize_xpm);
    icons[Icon_create_database] = wxIcon(create_database_xpm);
    icons[Icon_settings]        = wxIcon(settings_xpm);
    icons[Icon_tools]           = wxIcon(tools_xpm);

    //   unsigned int NbIcons = 8;
    // Make an image list containing small icons

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::CreateSettingsDialog ( wxNotebook *  nb,
wxDialog *  dial 
) [private]

Creates the settings dialog (the pages inside and the information).

Definition at line 999 of file creaImageIOWxGimmickView.cpp.

Referenced by OnImportExport().

                        {
                                wxMessageBox(_T("One or both of the directory fields are empty"),_T("Empty Fields"),wxOK,this);
                        }
        }
        delete gimmickTools;
#endif
        }
        mViewer->StartPlayer();
  }

  //=================================================

  void WxGimmickView::CreateSettingsDialog(wxNotebook* nb, wxDialog* dial)
  {
          //First page: Customization of configurations
          //Copy Path string
          std::string cp;
          mGimmick->GetSetting(SETTINGS_COPY_PATH,cp);
          //Database Path String
          std::string dp;
          mGimmick->GetSetting(SETTINGS_DBPATH,dp);
          //Syncronization Event String
          std::string se;
          mGimmick->GetSetting(SETTINGS_SYNC_EVENT,se);
          //Syncronization Frequency String
          std::string sf;
          mGimmick->GetSetting(SETTINGS_SYNC_FREQ,sf);

          WxCustomizeConfigPanel * customConfig=new WxCustomizeConfigPanel(nb,dial,this,cp,dp,se,sf);

          nb->AddPage( customConfig, crea::std2wx("Customize Configuration") );

          //Second page: Creation of Databases
          /*wxPanel* databaseCreation=new wxPanel(nb);
          nb->AddPage( databaseCreation, crea::std2wx("Create Database") );*/

Here is the caller graph for this function:

void creaImageIO::GimmickView::CreateSingleTreeView ( std::string &  i_name  )  [inherited]

Create a tree view with a given name.

Definition at line 130 of file creaImageIOGimmickView.cpp.

References creaImageIO::GimmickView::CreateTreeView(), and creaImageIO::GimmickView::mGimmick.

  {
        this->CreateTreeView(mGimmick->GetTreeHandlerMap()[i_name]);
     
  }

Here is the call graph for this function:

void creaImageIO::WxGimmickView::CreateToolBar (  )  [protected]

Creates the tool bar.

Definition at line 199 of file creaImageIOWxGimmickView.cpp.

References GimmickDebugMessage, mIcon, mViewer, and creaImageIO::WxViewer::StopPlayer().

Referenced by WxGimmickView().

  {
        // stop the viewer before application exit.
    mViewer->StopPlayer();
    GimmickDebugMessage(1,"WxGimmickView::~WxGimmickView"
                        <<std::endl);
        delete mIcon;
        delete mViewer;
    //if(mListener->IsAlive())   {        mListener->Delete();    }
  }
  //======================================================================
  
  //======================================================================
  void WxGimmickView::CreateToolBar()
  {
    long style = wxTB_HORIZONTAL | wxNO_BORDER | wxTB_TEXT;
    mToolBar = new wxToolBar(this,-1,wxDefaultPosition,wxDefaultSize,
                             style);

    mToolAddFile = mToolBar->AddTool( TOOL_ADDFILES_ID, 
                                      _T("Add file(s)"),
                                      mIcon->GetBitmap(Icon_page_down),
                                      _T("Add one or more file to database")
                                      );
    mToolAddDir = mToolBar->AddTool( TOOL_ADDDIR_ID, 
                                      _T("Add folder"),
                                      mIcon->GetBitmap(Icon_folder_down),
                                      _T("Add the content of a folder to database")
                                      );
    mToolAddDatabase = mToolBar->AddTool( TOOL_ADDDATABASE_ID, 
                                      _T("Open database"),
                                      mIcon->GetBitmap(Icon_database_add),
                                      _T("Open a local or distant database")
                                      );
    mToolRemove = mToolBar->AddTool( TOOL_REMOVE_ID, 
                                      _T("Remove"),
                                      mIcon->GetBitmap(Icon_remove),
                                      _T("Remove selected items")
                                      );
    mToolSynchronize = mToolBar->AddTool( TOOL_SYNCHRONIZE_ID, 
                                      _T("Synchronize"),
                                      mIcon->GetBitmap(Icon_synchronize),
                                      _T("Synchronizes the database with disk")
                                      );
    mToolHelp = mToolBar->AddTool( TOOL_HELP_ID, 
                                      _T("Help"),
                                      mIcon->GetBitmap(Icon_help),
                                      _T("Open help window")
                                      );
    mToolSettings = mToolBar->AddTool( TOOL_SETTINGS_ID, 
                                      _T("System settings"),
                                      mIcon->GetBitmap(Icon_settings),
                                      _T("Allows the modification of various system settings")
                                      );
    mToolTools = mToolBar->AddTool( TOOL_TOOLS_ID, 
                                      _T("Tools"),
                                      mIcon->GetBitmap(Icon_tools),
                                      _T("Applies tools to images")
                                      );

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::CreateTreeView ( TreeHandler h  )  [protected, virtual]

Create the tree view for TreeHandler provided.

Create the tree view for TreeHandler provided (overloaded from GimmickView)

Reimplemented from creaImageIO::GimmickView.

Definition at line 266 of file creaImageIOWxGimmickView.cpp.

void creaImageIO::GimmickView::CreateTreeViews (  )  [inherited]

Create the tree views.

Definition at line 117 of file creaImageIOGimmickView.cpp.

References creaImageIO::GimmickView::CreateTreeView(), GimmickMessage, and creaImageIO::GimmickView::mGimmick.

Referenced by WxGimmickView().

  {
    GimmickMessage(2,"Creating the tree views"<<std::endl);
    Gimmick::TreeHandlerMapType::const_iterator i;
    for (i = mGimmick->GetTreeHandlerMap().begin();
         i!= mGimmick->GetTreeHandlerMap().end();
         ++i)
      {
        this->CreateTreeView(i->second);
      }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::DisplayAddSummary (  )  [private]

Display a message box with the last addition statistics.

Definition at line 1219 of file creaImageIOWxGimmickView.cpp.

        {
                if (!mProgressDialog->Pulse(s)) 
                  {

void creaImageIO::WxGimmickView::DumpTags ( const std::string  i_filename  )  [private, virtual]

Display all Dicom Tags.

Reimplemented from creaImageIO::GimmickView.

Definition at line 1144 of file creaImageIOWxGimmickView.cpp.

References creaImageIO::tree::Node::GetLabel().

  {
    wxDialog* dial= new wxDialog (this,-1,crea::std2wx("Edit Fields for node "+node->GetLabel()),wxDefaultPosition, wxSize(350,155));

Here is the call graph for this function:

void creaImageIO::WxGimmickView::ExportImages (  )  [private]

Definition at line 898 of file creaImageIOWxGimmickView.cpp.

References creaImageIO::GimmickView::GetTreeViewMap(), and mNotebook.

  {
        wxBusyCursor busy;
        // Test if one image is selected => export
        // if not =>import
    if (GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))])

Here is the call graph for this function:

void creaImageIO::WxGimmickView::ExportToStorage ( const std::vector< std::string >  i_filenames  )  [private, virtual]

Export from Storage to Storage.

Reimplemented from creaImageIO::GimmickView.

Definition at line 1151 of file creaImageIOWxGimmickView.cpp.

  {
    WxDumpPanel* pan= new WxDumpPanel (this,i_filename);
    pan->ShowModal();  
  }

  //========================================================================
  void WxGimmickView::ExportToStorage(const std::vector<std::string> i_filenames)
  {
        std::vector<std::string> storages;
        Gimmick::TreeHandlerMapType::iterator it = mGimmick->GetTreeHandlerMap().begin();
        for(;it != mGimmick->GetTreeHandlerMap().end(); it++)
        {
                storages.push_back(it->first);
        }

    WxExportDlg* exp= new WxExportDlg(this,storages);
        if ( exp->ShowModal() ==ID_EXPORT_OK)
        {
                std::string storage = exp->GetStorage();
                mProgressDialog = 
            new wxProgressDialog(_T("Adding file(s)"),
                               _T(""),

std::string creaImageIO::WxGimmickView::ExtractName ( const std::string &  i_name  )  [private]
void creaImageIO::GimmickView::Finalize (  )  [virtual, inherited]

Finalize.

Definition at line 109 of file creaImageIOGimmickView.cpp.

  {
  }

vtkImageData* creaImageIO::GimmickView::GetDefaultImage (  )  [inline, inherited]

Definition at line 175 of file creaImageIOGimmickView.h.

References creaImageIO::MultiThreadImageReader::GetImage(), and creaImageIO::GimmickView::mReader.

Referenced by creaImageIO::GimmickView::OnMultiThreadImageReaderEvent(), OnRemove(), and WxGimmickView().

{ return mReader.GetImage(""); }

Here is the call graph for this function:

Here is the caller graph for this function:

virtual DicomDatabaseListType& creaImageIO::GimmickView::GetDicomDatabaseList (  )  [inline, virtual, inherited]

Returns the list of DicomDatabase open.

Definition at line 39 of file OldcreaImageIOGimmickView.h.

    { return null; }

virtual const DicomDatabaseListType& creaImageIO::GimmickView::GetDicomDatabaseList (  )  const [inline, virtual, inherited]

Returns the list of DicomDatabase open (const).

Definition at line 42 of file OldcreaImageIOGimmickView.h.

    { return null; }

virtual DicomNode* creaImageIO::GimmickView::GetDicomNodeOfItem ( const TreeItemId &  i  )  [virtual, inherited]

Returns the DicomNode corresponding to the tree item.

void creaImageIO::WxGimmickView::GetImages ( int  dim,
const std::vector< std::string > &  files,
std::vector< vtkImageData * > &  s 
)

Returns the images indicated by the filenames in the vector so that they comply with the given parameter(dim)

Definition at line 407 of file creaImageIOWxGimmickView.cpp.

virtual void creaImageIO::GimmickView::GetImages ( int  dim,
std::vector< std::string >  files,
std::vector< vtkImageData * > &  s 
) [inline, virtual, inherited]

Definition at line 93 of file creaImageIOGimmickView.h.

References GimmickError.

      { GimmickError("INTERNAL ERROR : GetImages not implemented"); }

int creaImageIO::GimmickView::GetMaximalPriority (  )  [inline, inherited]

Returns the maximal priority.

Definition at line 80 of file creaImageIOGimmickView.h.

References creaImageIO::MultiThreadImageReader::GetMaximalPriority(), and creaImageIO::GimmickView::mReader.

{return mReader.GetMaximalPriority();}

Here is the call graph for this function:

std::string creaImageIO::GimmickView::GetMessage (  )  [inline, inherited]

Obtains the message of the state.

Definition at line 148 of file creaImageIOGimmickView.h.

References creaImageIO::GimmickView::mMess.

{return mMess;}

QMutex* creaImageIO::MultiThreadImageReaderUser::GetMultiThreadImageReaderUserMutex (  )  [inline, inherited]
wxMutex& creaImageIO::MultiThreadImageReaderUser::GetMultiThreadImageReaderUserMutex (  )  [inline, inherited]
virtual void creaImageIO::GimmickView::GetSelectedDicomNodes ( std::vector< DicomNode * > &   )  [inline, virtual, inherited]

Returns the vector of DicomNode corresponding to selection.

Definition at line 31 of file OldcreaImageIOGimmickView.h.

{ return; }

void creaImageIO::WxGimmickView::GetSelectedFiles ( std::vector< std::string > &  s  )  [virtual]

Returns the selected files (overloaded from GimmickView)

Reimplemented from creaImageIO::GimmickView.

Definition at line 400 of file creaImageIOWxGimmickView.cpp.

void creaImageIO::WxGimmickView::getSelectedFiles ( std::vector< OutStrGimmick > &  outG,
std::vector< std::string >  i_attr,
bool  mult = false,
const std::string  out_model = "" 
)

Returns the selected files in output structure.

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

Definition at line 310 of file creaImageIOWxGimmickView.cpp.

References creaImageIO::GimmickView::GetTreeViewMap(), mNotebook, and creaImageIO::GimmickView::ReadImagesNotThreadedInVector().

  {
        std::vector<std::string> files;
        std::string db_name = crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()));
        GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->GetSelectedAsString(files);

        ReadImagesNotThreadedInVector(s, files, dim);
  }


  void WxGimmickView::getSelectedFiles(std::vector<OutStrGimmick> &outG, std::vector< std::string> i_attr, 
                                       bool mult, const std::string out_model)
  {
        // First we select the 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);

        std::string asking;
        std::string dim;
        bool bsingle = isSingle(files.front());
        int i_dim_out;
        mGimmick->GetSetting(SETTINGS_OUTPUT_ASK, asking);
        mGimmick->GetSetting(SETTINGS_OUTPUT_DIM, dim);

        if (asking == "true")
        {
                // display the output dialog box
                // get dim
                int idim;
                sscanf(dim.c_str(),"%d",&idim);
                WxOutputDlg *dlg = new WxOutputDlg(this,files, idim -1, bsingle);
                if (dlg->ShowModal() == wxID_OK)
                {
                        dim = dlg->getDim();
                        mGimmick->UpdateSetting(SETTINGS_OUTPUT_ASK, dlg->getAsking());
                        mGimmick->UpdateSetting(SETTINGS_OUTPUT_DIM, dim);
                }
                else
                {
                        return;
                } 
        }
        else
        {
        }
        sscanf(dim.c_str(),"%d",&i_dim_out);


        // Next we create the structure for dicom output infos
        OutputAttr Oattr;
        Oattr.db = crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()));
        if(i_attr.empty())
        {
                // We don't send informations!
        }
        else if( i_attr.size() == 1 && i_attr.front() == "ALL")
        {
                // we send all database
                Oattr.inside.push_back("ALL");
        }
        else if( (i_attr.size() == 1 && i_attr.front() != "ALL") 
                || (i_attr.size() >1) )
        {
                mGimmick->fillVectInfos(i_attr, Oattr);
        }
        else
        {
                // nothing
        }

        // Next we create model and sort files
        std::vector<std::string> sort_files(files);
        double zspacing = 1;

Here is the call graph for this function:

void creaImageIO::WxGimmickView::GetSelectedImages ( std::vector< vtkImageData * > &  s,
int  dim 
) [virtual]

Returns the selected Images so that they comply with the given parameter(4D) (overloaded from GimmickView)

Reimplemented from creaImageIO::GimmickView.

Definition at line 284 of file creaImageIOWxGimmickView.cpp.

             : TEST THAT A VIEW WITH SAME NAME IS NOT
    // ALREADY IN THE MAP
    GetTreeViewMap()[name] = view;

virtual void creaImageIO::GimmickView::GetSelectedImages ( std::vector< vtkImageData * > &   )  [inline, virtual, inherited]

Returns the vector of images corresponding to selection.

Definition at line 29 of file OldcreaImageIOGimmickView.h.

{ return; }

void creaImageIO::WxGimmickView::GetSelectedImagesInVector ( std::vector< vtkImageData * > &  s,
int  dim 
) [virtual]

Adds the selected Images to the given vector.

Reimplemented from creaImageIO::GimmickView.

Definition at line 298 of file creaImageIOWxGimmickView.cpp.

References creaImageIO::GimmickView::GetTreeViewMap(), and mNotebook.

  {
        std::vector<std::string> files;
        GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->GetSelectedAsString(files);
        //ReadImagesNotThreaded(s, files, dim);

Here is the call graph for this function:

virtual int creaImageIO::GimmickView::GetSelectionSize (  )  [inline, virtual, inherited]

Returns the size of the current selection.

Definition at line 23 of file OldcreaImageIOGimmickView.h.

{ return 0; } 

TreeViewMapType& creaImageIO::GimmickView::GetTreeViewMap (  )  [inline, inherited]

Returns the TreeViewMap (ref).

Definition at line 71 of file creaImageIOGimmickView.h.

References creaImageIO::GimmickView::mTreeViewMap.

Referenced by CreateIconList(), ExportImages(), getSelectedFiles(), GetSelectedImagesInVector(), OnSaveSettingsCallback(), and creaImageIO::GimmickView::UpdateTreeViewLevel().

{ return mTreeViewMap; }

Here is the caller graph for this function:

const TreeViewMapType& creaImageIO::GimmickView::GetTreeViewMap (  )  const [inline, inherited]

Returns the TreeViewMap (const ref).

Definition at line 73 of file creaImageIOGimmickView.h.

References creaImageIO::GimmickView::mTreeViewMap.

      { return mTreeViewMap; }

void creaImageIO::WxGimmickView::GetVisibleAttributes ( std::vector< std::string > &  shown,
std::vector< std::string > &  nShown,
int  level 
)

Called upon to return the visible attributes of the current tab.

Definition at line 1041 of file creaImageIOWxGimmickView.cpp.

Referenced by creaImageIO::WxAttributeSelectionPanel::OnComboChange().

                      : CD/DVD Watch
          WxListenerPanel* cdWatch=new WxListenerPanel(nb,dial, this,true);//, mListener->IsPaused());
          nb->AddPage( cdWatch, crea::std2wx("CD/DVD") );

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::ImportImages (  )  [private]

Definition at line 906 of file creaImageIOWxGimmickView.cpp.

void creaImageIO::GimmickView::Initialize (  )  [virtual, inherited]

Initializes the view : Creates the TreeViews for all the TreeHandler of the Controller

Definition at line 101 of file creaImageIOGimmickView.cpp.

References creaImageIO::GimmickView::mReaderStarted.

Referenced by creaImageIO::WxGimmickFrame::WxGimmickFrame(), creaImageIO::WxGimmickPanel::WxGimmickPanel(), and creaImageIO::WxGimmickReaderDialog::WxGimmickReaderDialog().

  {
        mReaderStarted=false;
  }

Here is the caller graph for this function:

bool creaImageIO::WxGimmickView::isNeedRecursive ( std::string  i_name  )  [private]

Test a directory to know if contains sub-directory to analyze.

Definition at line 590 of file creaImageIOWxGimmickView.cpp.

References NumberFilesToAdd().

                {
                        if (recursive) 
                        {
                                nb += NumberFilesToAdd(itr->string(), recursive);
                        }
                }
                else
                {
                        nb++;
                }
          }
        return nb;
  }

Here is the call graph for this function:

virtual bool creaImageIO::GimmickView::IsSelectionValid (  )  [inline, virtual, inherited]

Returns true if there is a valid selection.

Definition at line 25 of file OldcreaImageIOGimmickView.h.

{ return false; }

bool creaImageIO::GimmickView::isSingle ( const std::string  i_file  )  [inherited]

Definition at line 419 of file creaImageIOGimmickView.cpp.

References creaImageIO::MultiThreadImageReader::GetImage(), and creaImageIO::GimmickView::mReader.

Referenced by creaImageIO::GimmickView::readImages().

        {
                bool bres = true;
                vtkImageData* first = mReader.GetImage( i_file);
                int dim[3];
                first->GetDimensions(dim);
                if (dim[2] > 1)
                {
                        bres = false;
                }
                else
                {
                }
                return bres;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::killProgress (  )  [private]

Definition at line 1299 of file creaImageIOWxGimmickView.cpp.

virtual void creaImageIO::GimmickView::LoadOrCreateFavoritesDatabase (  )  [inline, virtual, inherited]

Loads or creates a favorites database.

Definition at line 74 of file OldcreaImageIOGimmickView.h.

{ return; }

void creaImageIO::GimmickView::modifyValidationSignal ( bool  ivalid  )  [inherited]
void creaImageIO::MultiThreadImageReaderUser::MultiThreadImageReaderEventLock (  )  [inline, inherited]

Definition at line 53 of file creaImageIOMultiThreadImageReader.h.

Referenced by creaImageIO::ThreadedImageReader::Entry().

Here is the caller graph for this function:

void creaImageIO::MultiThreadImageReaderUser::MultiThreadImageReaderEventLock (  )  [inline, inherited]
void creaImageIO::MultiThreadImageReaderUser::MultiThreadImageReaderEventUnlock (  )  [inline, inherited]
void creaImageIO::MultiThreadImageReaderUser::MultiThreadImageReaderEventUnlock (  )  [inline, inherited]

Definition at line 55 of file creaImageIOMultiThreadImageReader.h.

Referenced by creaImageIO::ThreadedImageReader::Entry().

Here is the caller graph for this function:

bool creaImageIO::GimmickView::NoValidateSelected (  )  [inherited]

No selected image.

Definition at line 195 of file creaImageIOGimmickView.cpp.

References GimmickDebugMessage, creaImageIO::GimmickView::modifyValidationSignal(), creaImageIO::GimmickView::SetMessage(), and creaImageIO::GimmickView::valid.

  {
        GimmickDebugMessage(2,"Validating selected"<<std::endl);
        std::string mMessage;
        mMessage="Cannot have 0 images selected!";
        valid=false;
        modifyValidationSignal(valid);
        SetMessage(mMessage);
        return valid;
  }

Here is the call graph for this function:

int creaImageIO::WxGimmickView::NumberFilesToAdd ( const std::string &  dirpath,
bool  recursive 
) [private]

Determines number of files potentially to add to database.

Definition at line 565 of file creaImageIOWxGimmickView.cpp.

Referenced by isNeedRecursive().

  {
           int nb = 0;
           if ( !boost::filesystem::exists( dirpath ) ) return nb;
           boost::filesystem::directory_iterator end_itr; // default construction yields past-the-end
           for ( boost::filesystem::directory_iterator itr( dirpath );  itr != end_itr;  ++itr )

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::OnAddDB ( wxCommandEvent &  event  )  [private]

callback to add a database

Definition at line 1233 of file creaImageIOWxGimmickView.cpp.

References mGimmick, and mstart.

  {
      std::stringstream mess(mGimmick->getSummary());
    time_t end;
        time(&end);
        mess << "time to scan :" << difftime(end,mstart) << "sec";
    wxMessageBox(std2wx(mess.str()),_T("Addition result"),wxOK,this);
  }

  // Add a DB to application                    //
  // @param event : WxEvent                     //
  // @return : -                                //
  void WxGimmickView::OnAddDB(wxCommandEvent& event)
  {
          //Select DB
          long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
          std::string wc("*.sqlite3*");
          wxFileDialog* FD = new wxFileDialog( 0, 
                                         _T("Select file"),
                                         _T(""),
                                         _T(""),
                                         crea::std2wx(wc),
                                         style,
                                         wxDefaultPosition);
    
    if (FD->ShowModal()==wxID_OK)
        {
                wxBusyCursor busy;
                wxArrayString files;

void creaImageIO::WxGimmickView::OnAddDir ( wxCommandEvent &  event  )  [private]

Callback for adding dir.

Definition at line 511 of file creaImageIOWxGimmickView.cpp.

                 : select the current tree handler
        mGimmick->AddFiles(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),filenames);

        mProgressDialog->Pulse(_T("Updating view..."));

        UpdateTreeViewLevel(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),1);
        killProgress();
        DisplayAddSummary();    

      }
        mViewer->StartPlayer(); 
  }
  //=================================================

  //=================================================
  void WxGimmickView::OnAddDir(wxCommandEvent& event)
  {
    mViewer->StopPlayer();
        std::string name = crea::wx2std(mNotebook->GetCurrentPage()->GetName());
    long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
    wxDirDialog* FD = 
         new wxDirDialog( 0, 
                       _T("Select directory"),
                       mCurrentDirectory,
                       style);
    
    if (FD->ShowModal()==wxID_OK)
    {
                        time(&mstart);
        std::string dirname = wx2std (FD->GetPath());
        bool recurse =  isNeedRecursive(dirname);
        if (recurse)
        {
             recurse = wxMessageBox(_T("Recurse into sub-directories ?"), _T("Scan directory"), wxYES_NO,this ) == wxYES ? true : false;
        }

                wxBusyCursor busy;
                wxString title(_T("Adding directory"));
                if (recurse) 
                title = _T("Adding directory (recursive)");
                mProgressDialog = 
                new wxProgressDialog(_T("Adding directory"),
                                        _T(""),
                                        NumberFilesToAdd(dirname,recurse),

//EED                                   this,
                                        NULL,

                                        wxPD_ELAPSED_TIME | 

void creaImageIO::WxGimmickView::OnAddFiles ( wxCommandEvent &  event  )  [private]

Callback for adding files.

Definition at line 458 of file creaImageIOWxGimmickView.cpp.

References mIcon.

      {
        if ( size == sizeOrig )
          {
            mIcon->Add(icons[i]);
          }
        else
          {
            mIcon->Add(wxBitmap(wxBitmap(icons[i]).ConvertToImage().Rescale(size, size)));
          }
      }
  }
  //=================================================


  //=================================================
  void WxGimmickView::OnAddFiles(wxCommandEvent& event)
  {
    mViewer->StopPlayer();
    long style = wxOPEN | wxFILE_MUST_EXIST | wxFD_MULTIPLE;
    std::string wc("*");
    wxFileDialog* FD = new wxFileDialog( 0, 
                                         _T("Select file"),
                                         _T(""),
                                         _T(""),
                                         crea::std2wx(wc),
                                         style,
                                         wxDefaultPosition);
    
    if (FD->ShowModal()==wxID_OK)
      {
        wxBusyCursor busy;

        wxArrayString files;
        FD->GetPaths(files);
        unsigned int i;
        std::vector<std::string> filenames;
        for (i=0;i<files.GetCount();++i)
        {
          filenames.push_back(wx2std(files[i]));
          GimmickMessage(2,"Adding File "<<files[i]<<"."<<std::endl);
        }

        mProgressDialog = 
          new wxProgressDialog(_T("Adding file(s)"),
                               _T(""),
                               1000,
//                             this,
                               NULL,
                               wxPD_ELAPSED_TIME |

void creaImageIO::WxGimmickView::OnAddProgress ( Gimmick::AddProgress p  )  [private]

AddProgress Gimmick callback.

Definition at line 1195 of file creaImageIOWxGimmickView.cpp.

Referenced by WxGimmickView().

  {
     mGimmick->EditField(node, crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())), name, key, val);
     UpdateTreeViewLevel(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),1);
  }

  //=================================================
  void WxGimmickView::OnAddProgress( Gimmick::AddProgress& p)
  {
    char mess[200];
    sprintf(mess,"%i dirs : %i files :\n            %i handled - %i added",
           p.GetNumberScannedDirs(),

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::OnAttributesChanged ( const std::vector< std::string > &  nShown,
int  level 
)

Called when there has been a change in the visible attributes of a tree view.

Definition at line 1048 of file creaImageIOWxGimmickView.cpp.

Referenced by creaImageIO::WxAttributeSelectionPanel::OnSaveConfig().

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::OnCreateDB ( wxCommandEvent &  event  )  [private]

Create a DB from an Attributes Descriptor files.

Definition at line 1271 of file creaImageIOWxGimmickView.cpp.

                  : WxEvent                                     //
  // @return : -                                                //
  void WxGimmickView::OnCreateDB(wxCommandEvent& event)
  {
        //  PACSConnection("");
        WxDescriptorPanel * DescriptorPan = new WxDescriptorPanel(this, mGimmick->GetHomeDirectory());
        DescriptorPan->Layout();
        if ( DescriptorPan->ShowModal() == ID_DSCP_APPLY)
        {
                wxBusyCursor busy;
                std::string file(DescriptorPan->GetDescriptor());
                if (!file.empty())
                {

void creaImageIO::WxGimmickView::OnDriveMount ( bool  mount  ) 

Acts upon a drive mount.

Definition at line 1076 of file creaImageIOWxGimmickView.cpp.

  {
         mListener->SetMonitoredDrive(drive);
         mListener->SetAddFilesState(addFiles);
         mListener->SetRemoveFilesState(removeFiles);
  }

  //========================================================================

  void WxGimmickView::OnDriveMount(bool mount)
  {
          GimmickMessage(1, "Gimmick::OnDriveMount"<<std::endl);
          std::string drive;
          mListener->GetMonitoredDrive(drive);
          
          if(mount)
          {
                mViewer->StopPlayer();
                wxBusyCursor busy;
                wxString title(_T("Adding drive"));
                mProgressDialog = 
                new wxProgressDialog(_T("Adding drive"),
                                        _T(""),
                                        1000,

//EED                                   this,
                                        NULL,

                                        wxPD_ELAPSED_TIME |
                                        //                             wxPD_ESTIMATED_TIME | 
                                        //                             wxPD_REMAINING_TIME |

void creaImageIO::WxGimmickView::OnFieldsEdited ( tree::Node node,
const std::string &  name,
const std::string &  key,
const std::string &  val 
)

Called upon when a field has been edited.

Definition at line 1187 of file creaImageIOWxGimmickView.cpp.

Referenced by creaImageIO::WxEditFieldsPanel::OnEdit().

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::OnImportExport ( wxCommandEvent &  event  )  [private]

Callback for Import/Export images.

Definition at line 883 of file creaImageIOWxGimmickView.cpp.

References CreateSettingsDialog().

  {
    wxDialog* dial= new wxDialog (this,-1,_T("System Settings"),wxDefaultPosition, wxSize(450,220));
    wxBoxSizer  *siz = new wxBoxSizer(wxVERTICAL);
    // Notebook
    wxNotebook* nb= new wxNotebook(dial, -1, wxDefaultPosition, wxDefaultSize, 0);
    
    siz->Add( nb,1,wxGROW  ,0);  
    CreateSettingsDialog(nb,dial);
    dial->SetSizer(siz);
    dial->ShowModal();
  }

Here is the call graph for this function:

void creaImageIO::WxGimmickView::OnListenerCallback ( const std::string &  drive,
bool  addFiles,
bool  removeFiles 
)

Changes listener state.

Definition at line 1067 of file creaImageIOWxGimmickView.cpp.

Referenced by creaImageIO::WxListenerPanel::OnChangeListenState().

Here is the caller graph for this function:

void creaImageIO::GimmickView::OnMultiThreadImageReaderEvent ( const std::string &  filename,
MultiThreadImageReaderUser::EventType  type,
vtkImageData *  image 
) [virtual, inherited]

The virtual method to overload by MultiThreadImageReader users It is called when an image has been loaded or unloaded Provides : The image file name which was requested The type of event If type==ImageLoaded the image pointer, else NULL pointer

Reimplemented from creaImageIO::MultiThreadImageReaderUser.

Definition at line 755 of file creaImageIOGimmickView.cpp.

References creaImageIO::MultiThreadImageReaderUser::Error, creaImageIO::GimmickView::GetDefaultImage(), GimmickDebugMessage, GimmickMessage, creaImageIO::GimmickView::ImageEventType::image, creaImageIO::MultiThreadImageReaderUser::ImageLoaded, creaImageIO::MultiThreadImageReaderUser::ImageUnloaded, creaImageIO::GimmickView::mImageEventMap, and creaImageIO::GimmickView::ImageEventType::pointerHolder.

  {
    GimmickDebugMessage(7,
                        "MultiThreadImageReader event : "<<e<<std::endl);
        if (e==ImageLoaded)
        {
                if (filename.size()==0)
                {
                  //What to do in this case?
                  /*
                        GimmickDebugMessage(5,
                                        "Pushing unknown image in queue"
                                        <<std::endl);
                        mImageEventQueue.push_back(ImageEventType(image));*/
                        return;
                }
                ImageEventTypeMap::iterator i;
//JCP 22-06-2009, test mImageEventMap.size() > 0
                if(mImageEventMap.size()>0){
                        i = mImageEventMap.find(filename);
                        if (i!=mImageEventMap.end())
                        {
                                GimmickDebugMessage(5,
                                                "Putting image of file '"<<filename<<"' on pointer"
                                                <<std::endl);
                                ImageEventType ie(i->second);
                                ie.image = image;
                                ie.pointerHolder->Set(ie.image);
                                //mImageEventMap.erase(i);
                        }
                }    
        }
        else if (e==Error)
        {
                std::string mess="ERROR: MultiThreadImageReader: Cannot read image in file ";
                mess+=filename;
                mess+="\n";
                GimmickMessage(1,mess);
                ImageEventTypeMap::iterator i;
                i = mImageEventMap.find(filename);
                if (i!=mImageEventMap.end())
                {
                ImageEventType ie(i->second);
                ie.image = image;
                ie.pointerHolder->Set(GetDefaultImage());
                //mImageEventMap.erase(i);
                }
        }

        else if (e==ImageUnloaded)
        {
                std::string mess="Unloaded image in file ";
                mess+=filename;
                mess+="\n";
                GimmickMessage(1,mess);
                                ImageEventTypeMap::iterator i;
                i = mImageEventMap.find(filename);
                if (i!=mImageEventMap.end())
                {
                ImageEventType ie(i->second);
                ie.image = image;
                ie.pointerHolder->Set(GetDefaultImage());
                //mImageEventMap.erase(i);
                }
        }
  }

Here is the call graph for this function:

void creaImageIO::WxGimmickView::OnRemove ( wxCommandEvent &  event  )  [private]

Callback for removing files.

Definition at line 788 of file creaImageIOWxGimmickView.cpp.

References creaImageIO::GimmickView::GetDefaultImage(), mViewer, pointers, creaImageIO::WxViewer::RefreshIfNecessary(), creaImageIO::GimmickView::ResetExtent(), and creaImageIO::WxViewer::SetImageVector().

   {
        pointers.clear();
        pointers.push_back(boost::shared_ptr<creaImageIO::ImagePointerHolder>(new ImagePointerHolder(GetDefaultImage())));
        //pointers.push_back(new ImagePointerHolder(GetDefaultImage()));
        mViewer->SetImageVector(pointers);
        mViewer->RefreshIfNecessary();

Here is the call graph for this function:

void creaImageIO::WxGimmickView::OnSaveSettingsCallback ( const std::string &  copyPath,
const std::string &  dbPath,
const std::string &  syncEvent,
const std::string &  syncFreq 
)

Saves the settings to the file.

Definition at line 1055 of file creaImageIOWxGimmickView.cpp.

References creaImageIO::GimmickView::GetTreeViewMap(), and mNotebook.

Referenced by creaImageIO::WxCustomizeConfigPanel::OnSaveConfig().

  {
          GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->GetAttributes(shown,nShown,level);
  }

  //===================================================================
  void WxGimmickView::OnAttributesChanged(const std::vector<std::string>& nShown, int level)

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::OnSelectionChange ( const std::vector< tree::Node * > &  s,
bool  isSelection,
int  selection,
bool  mProcess 
) [virtual]

Callback called when a selection from a TreeView has changed.

Reimplemented from creaImageIO::GimmickView.

Definition at line 606 of file creaImageIOWxGimmickView.cpp.

  {
      boost::filesystem::directory_iterator iter(i_name), end_iter;
          bool bfindir = false;
                  for(; iter != end_iter; ++iter)
                  {
                          if(boost::filesystem::is_directory(*iter))
                          {
                                  return true;
                          }
                  }
                  return false;
  }
  //=================================================

  //=================================================
  void WxGimmickView::OnSelectionChange(const std::vector<tree::Node*>& sel, bool isSelection, int selection, bool needProcess)
  {      
    GimmickDebugMessage(5,
                        "WxGimmickView::OnSelectionChange"
                        <<std::endl);
    wxBusyCursor busy;
        bool valid=true;
        
        if(sel.size()==0)
        {
                valid= ValidateSelected(NULL,
                                mSelectionMinDimension,
                                mSelectionMaxDimension );
        }
        else if(needProcess)
        {
                ResetExtent();
                std::vector<tree::Node*>::const_iterator i;
                for(i=sel.begin();i!=sel.end()&&valid;++i)
                {
                        valid= ValidateSelected((*i),
                                mSelectionMinDimension,
                                mSelectionMaxDimension );
                }
        }
        else if(isSelection)
        {
                valid= ValidateSelected(sel.front(),
                                mSelectionMinDimension,
                                mSelectionMaxDimension );
        }
        else
        {
                ResetExtent();
                std::vector<tree::Node*>::const_iterator i;
                for(i=sel.begin();i!=sel.end()&&valid;++i)
                {

void creaImageIO::WxGimmickView::OnSettings ( wxCommandEvent &  event  )  [private]

Callback for settings edition.

Definition at line 869 of file creaImageIOWxGimmickView.cpp.

                            {repair=true;}
        if(sel==1 || sel==3){checkAttributes=true;}
        std::string mess=mGimmick->Synchronize(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),repair, checkAttributes);
        wxMessageBox(std2wx(mess),_T("Synchronization result"),wxOK,this);
        if(sel==2 || sel==3){
                GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->UpdateLevel(1);
        }
                
    }

void creaImageIO::WxGimmickView::OnSynchronize ( wxCommandEvent &  event  )  [private]

Callback for synchronization.

Definition at line 834 of file creaImageIOWxGimmickView.cpp.

  {       
    wxBusyCursor busy;
    const wxString choices[] = { _T("Check database for files deletion and addition and give a report."), 
                                _T("Check database for files deletion, addition and attributes change. Then give a report."), 
                                _T("Repair database (remove deleted files and add new files)."), 
                                _T("Repair database (remove deleted files, add new files and reset changed attributes).") } ;

    wxSingleChoiceDialog dialog(this,
                                _T("Select one of the following synchronization actions:\n")
                                _T("Please note that, due to the heavy amount of operations required, this action might take a while."),
                                _T("Synchronization Settings"),
                                WXSIZEOF(choices), choices);

    //dialog.SetSelection(0);

void creaImageIO::WxGimmickView::OnTools ( wxCommandEvent &  event  )  [private]

Callback for settings edition.

Definition at line 918 of file creaImageIOWxGimmickView.cpp.

  {
                //Find the *.zip
                //dezip
                // Contain a descriptor.text
                // create a new database, and add to database
                // if not, add to current database
                // 
  }

  //=================================================
  //AndresDonadio
  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);
        wxNotebook* nb= new wxNotebook(dial, -1, wxDefaultPosition, wxDefaultSize, 0);
        wxBoxSizer *dialSizer = new wxBoxSizer(wxVERTICAL);     
        dialSizer->Add(nb,1,wxGROW,0);
        dialSizer->Add(buttonsSizer,0,wxGROW);

#if defined(BUILD_BRUKER)
        //First page: Bruker Image Reader
        WxGimmickTools * gimmickTools = new WxGimmickTools(nb, mCurrentDirectory);
        nb->AddPage( gimmickTools, _T("Bruker Image Reader") );
#endif

        dial->SetSizer(dialSizer, true);
        dial->Layout();
        dial->ShowModal();

        if (dial->GetReturnCode() == wxID_OK)
        {
#if defined(BUILD_BRUKER)
                if (nb->GetSelection()==0)//Selection: Bruker Image Reader  
                {
                        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)
                        {
                                if ( wxMessageBox(_T("Depending on the amount of Data the process can take several minutes. Do you want to continue?"),
                                                  _T("Please confirm"), wxICON_QUESTION | wxYES_NO) == wxYES )
                                {
                                        Bruker2Dicom b2d;    
                                        b2d.SetInputDirectory(inputDir);
                                        b2d.SetOutputDirectory(outputDir);
                                        b2d.SetConvertModeToDicom();
                                        b2d.verbose=false;
                                        b2d.Execute();
                                        if (addToDB)
                                        {
        std::cout <<"after addToDB" << std::endl;
                                                mProgressDialog = new wxProgressDialog(_T("Adding directory"),_T(""),1000,

//EED                                                                                   this,
                                                                                        NULL,

                                                                                        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;                                           
                                                killProgress();

virtual void creaImageIO::GimmickView::OpenOrNewDatabase ( bool  open  )  [inline, protected, virtual, inherited]

Opens an existing database, or else, creates a local database.

Definition at line 47 of file OldcreaImageIOGimmickView.h.

{ return; }

void creaImageIO::GimmickView::readImages ( std::vector< OutStrGimmick > &  o_output,
std::vector< std::string >  im,
OutputAttr  i_attr,
int  i_dim,
double  i_zspc 
) [inherited]

Definition at line 622 of file creaImageIOGimmickView.cpp.

References creaImageIO::GimmickView::isSingle(), creaImageIO::GimmickView::readImages1(), creaImageIO::GimmickView::readImages2(), creaImageIO::GimmickView::readImages3(), and creaImageIO::GimmickView::readImages4().

        {
                int size = im.size();
                if ( size == 0)
                {
                        return;
                }
                else if (size == 1)
                {
                        // Simplest case
                        // Only one image : give it
                        // But take in count multiframe possibility
                        if ( isSingle(im.front()) || i_dim != 1)
                        {
                                 readImages1(o_output,im, i_attr);
                        }
                        else
                        {
                                readImages2(o_output,im, i_attr,i_zspc);
                        }
                        
                }
                else
                {
                        // multiple or single frame
                        if ( isSingle(im.front()) )
                        {
                                //we deal with 2D images
                                if(i_dim == 1)
                                {
                                        // 2D to 3D
                                        readImages3(o_output,im, i_attr,i_zspc);
                                }
                                else
                                {
                                        readImages1(o_output,im, i_attr);
                                }
                        }
                        else
                        {
                                // we deal with multiple frames n x (2D x T)
                                // Differents outputs are avaialable
                                if(i_dim == 1)
                                {
                                        // put all in one output
                                        readImages3(o_output,im, i_attr,i_zspc);

                                }
                                else if( i_dim == 2)
                                {
                                        // put in a vector of n x T (2D)
                                        readImages2(o_output,im, i_attr,i_zspc);
                                }
                                else if( i_dim == 3)
                                {
                                        // put in a vector of n (2D x T)
                                        // No transformations.
                                        readImages1(o_output,im, i_attr);
                                }
                                else
                                {
                                        // put in a vector of T (2D x n)
                                        readImages4(o_output,im, i_attr);
                                }
                        }
                }
        }

Here is the call graph for this function:

void creaImageIO::GimmickView::ReadImagesNotThreaded ( std::vector< vtkImageData * > &  s,
std::vector< std::string >  files,
int  dim 
) [inherited]

Reads the vector of images, builds it in the dimension required and returns them in the supplied vector.

Reads Images (Non Threaded).

Definition at line 306 of file creaImageIOGimmickView.cpp.

References creaImageIO::MultiThreadImageReader::GetImage(), creaImageIO::GimmickView::mReader, and creaImageIO::GimmickView::stopReader().

{
        stopReader();
/* remember!

#define GIMMICK_NO_IMAGE_SELECTION 0
#define GIMMICK_2D_IMAGE_SELECTION 2
#define GIMMICK_3D_IMAGE_SELECTION 3
#define GIMMICK_4D_IMAGE_SELECTION 4

#define NATIVE 0
#define _2D    2
#define _3D    3

*/
        // Create the output data
        if (im.size()==1) 
        {
                vtkImageData * out=vtkImageData::New();
                out->ShallowCopy(mReader.GetImage(im.front()));
                s.push_back(out);
        }
    else if (im.size()>1) // Test inutile ? JPR
        {
                vtkImageData* first = mReader.GetImage( im.front());
                if (dimension == 2)
                {
                 // n3D
                    std::vector<std::string>::iterator it;
                        for (it=im.begin(); it!=im.end(); ++it) 
                        {
                                vtkImageData* out = vtkImageData::New();
                                out->ShallowCopy(mReader.GetImage(*it));
                                s.push_back(out);
                        }
                }         
                else 
                {
                        // n*2D to 3D
                        vtkImageData* out = vtkImageData::New();
//                      out->CopyStructure(first);      
                        out->SetScalarType(first->GetScalarType());
                        out->SetNumberOfScalarComponents(first->GetNumberOfScalarComponents());
                        int ext[6];
                        //first->GetExtent(ext);  // JPR
                        first->GetWholeExtent(ext);  // renvoie egalement 0,0 en Z // JPR

                        if(ext[5] == 0)
                        {
                                ext[5] = im.size()-1;
                        }
                        else
                        {
                                ext[5] = ext[5] * im.size()-1; // to deal with multiframes - JPR
                        }
                        out->SetExtent(ext);

                        // LG : TODO : Z Spacing  ?

                        int dim[3];
                        first->GetDimensions(dim);

                        out->SetDimensions(dim[0], dim[1], im.size() );
                        out->AllocateScalars();
                        out->Update();

                        unsigned long imsize = dim[0] * dim[1];
                        imsize = imsize * dim[2] ;  // deal with multiframes // JPR


//EED 03-11-2009
                        // differents formats char , short, etc...
                        // differents components 1..3  ex. jpg ->RGB 3
                        imsize = imsize * first->GetScalarSize() * first->GetNumberOfScalarComponents();


                        // Order the file name vector

                        double spc[3];
                        first->GetSpacing(spc);

                        // OrderTheFileNameVector is not here anymore.
                        // Try orderFilesWithZSpacing from OutputModel FCY
                        // spc[2]=OrderTheFileNameVector(im);   
                        spc[2] =1;

                        out->SetSpacing(spc);

                        int slice = 0;
                        std::vector<std::string>::iterator it;

                        for (it=im.begin(); it!=im.end(); ++it) 
                        {
                                vtkImageData* cur = mReader.GetImage( (*it) );
                                memcpy(out->GetScalarPointer(0,0,slice), cur->GetScalarPointer(0,0,0), imsize);
                                slice++;
                        }       
                        s.push_back(out);

                }  // dimension == 3

        }  // size >1

}

Here is the call graph for this function:

void creaImageIO::GimmickView::ReadImagesNotThreadedInVector ( std::vector< vtkImageData * > &  s,
std::vector< std::string >  files,
int  dim 
) [inherited]

Reads the vector of images, builds it in the dimension required and returns them in the supplied vector.

Definition at line 693 of file creaImageIOGimmickView.cpp.

References creaImageIO::MultiThreadImageReader::GetImage(), GimmickDebugMessage, and creaImageIO::GimmickView::mReader.

Referenced by getSelectedFiles().

{
        // Create the output data
        if (im.size()==1)
        {
                // Only one image : give it
                vtkImageData* out = vtkImageData::New();
                GimmickDebugMessage(3, "State Check: Full Filename: "
                                                <<im.front()
                                                <<std::endl);
                out->ShallowCopy(mReader.GetImage(im.front()));
                s.push_back( out );
        }
        else if (im.size()>1) // Test inutile ? JPR
        {
                vtkImageData* first = mReader.GetImage( im.front());
                if (dimension == 2)
                {
                 // n3D
                  std::vector<std::string>::iterator it;
                        for (it=im.begin(); it!=im.end(); ++it)
                        {
                                vtkImageData* out = vtkImageData::New();
                                out->ShallowCopy(mReader.GetImage(*it));
                                s.push_back(out);
                        }
                }
                else
                {
                        // n2D to 3D // NO!
                        // n *2D + T in a vector :
                        
                        std::vector<std::string>::iterator it;
                        for (it=im.begin(); it!=im.end(); ++it) 
                        {
                                vtkImageData* out = mReader.GetImage( (*it));
                                s.push_back(out);
                        }
                }
        }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::ReadImageThreaded ( const std::vector< tree::Node * > &  sel  ) 

Sends a request to read the currently selected node and the ones that surround it.

Reads Images (Threaded).

Definition at line 664 of file creaImageIOWxGimmickView.cpp.

      {
        ReadImageThreaded(sel);
      }
    else
      {
                  ClearSelection();
      }*/
        ReadImageThreaded(sel);
   }

  //==================================================

  //==================================================
  void WxGimmickView::ReadImageThreaded(const std::vector<tree::Node*>& sel)
  {     
   GimmickDebugMessage(5,
                       "ReadImageThreaded"
                       <<std::endl);
   int maxprio = GetMaximalPriority();
   int prio = maxprio + 2000;

   if(sel.size()>0)
   {
   //First load the selected images
   mCurImageItemToShow = sel.front();
   pointers.clear();
   int index = 0;
   std::vector<tree::Node*>::const_iterator selected;
   for(selected=sel.begin();selected!=sel.end();++selected)
     {
       GimmickDebugMessage(5,
                           "Requesting image from selected "
                           <<(*selected)->GetAttribute("FullFileName")
                           <<std::endl);
           //ImagePointerHolder* ph=new ImagePointerHolder(GetDefaultImage());
           boost::shared_ptr<ImagePointerHolder> ph(new ImagePointerHolder(GetDefaultImage()));
           pointers.push_back(ph);
       RequestReading(*selected,prio,index,ph);
       //       AddEntryToMap(*selected);
       prio--;
       index++;
     }
        mViewer->SetImageVector(pointers);
        //Going up
        prio = maxprio + 20;
        std::vector<tree::Node*> up;
        GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->GetNodes(up,true);
        std::vector<tree::Node*>::iterator iterUp;
        for(iterUp=up.begin();iterUp!=up.end();++iterUp)
        {
                GimmickDebugMessage(5,
                                "Requesting image from neighbors up "
                                <<(*iterUp)->GetAttribute("FullFileName")
                                <<std::endl);
//              ImagePointerHolder* ph=new ImagePointerHolder(GetDefaultImage());
                boost::shared_ptr<ImagePointerHolder> ph(new ImagePointerHolder(GetDefaultImage()));
                RequestReading(*iterUp,prio,-1,ph);
                //              AddEntryToMap(*iterUp);
                prio--;
                if (prio == maxprio) break;
        }

        //Going down
        prio = maxprio + 19;
        std::vector<tree::Node*> down;
        GetTreeViewMap()[crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection()))]->GetNodes(down,false);
        std::vector<tree::Node*>::iterator iterDown;
        for(iterDown=down.begin();iterDown!=down.end();++iterDown)
        {
                GimmickDebugMessage(5,
                                "Requesting image from neighbors down "
                                <<(*iterDown)->GetAttribute("FullFileName")
                                <<std::endl);
                //ImagePointerHolder* ph=new ImagePointerHolder(GetDefaultImage());

virtual void creaImageIO::GimmickView::RebuildView (  )  [inline, protected, virtual, inherited]

Completely rebuilds the view with current DicomDatabaseList

Definition at line 97 of file OldcreaImageIOGimmickView.h.

{ return; }

void creaImageIO::GimmickView::RequestReading ( tree::Node n,
int  prio,
int  selection_index,
boost::shared_ptr< ImagePointerHolder p 
) [inherited]

current selection (-1 if not in selection)

Requests the reading of an image.

Requests the reading of an image with priority and index in the

Definition at line 738 of file creaImageIOGimmickView.cpp.

References creaImageIO::tree::Node::GetAttribute(), creaImageIO::GimmickView::mImageEventMap, creaImageIO::GimmickView::mReader, creaImageIO::GimmickView::mReaderStarted, creaImageIO::GimmickView::ImageEventType::pointerHolder, creaImageIO::MultiThreadImageReader::Request(), and creaImageIO::MultiThreadImageReader::Start().

  {
          if(!mReaderStarted)
          {
                mReader.Start();
                mReaderStarted=true;
          }
    ImageEventType t(n,selection_index);
        t.pointerHolder = p;
    mImageEventMap[n->GetAttribute("FullFileName")] = t;    
    mReader.Request(this,n->GetAttribute("FullFileName"),prio);
  }

Here is the call graph for this function:

void creaImageIO::GimmickView::ResetExtent (  )  [inherited]

Resets the data of the extent and begins a new selection.

Clears the status and begins a new selection process.

Definition at line 156 of file creaImageIOGimmickView.cpp.

References creaImageIO::GimmickView::mImageExtent, and creaImageIO::GimmickView::valid.

Referenced by OnRemove().

  {
          if(mImageExtent!=0)
          {
                  mImageExtent.reset();
          }
          valid=true;
  }

Here is the caller graph for this function:

virtual void creaImageIO::GimmickView::SaveAs ( const std::vector< std::string > &  filenames  )  [inline, virtual, inherited]

Copies selected files.

Definition at line 127 of file creaImageIOGimmickView.h.

References GimmickError.

          { GimmickError("INTERNAL ERROR : SaveAs not implemented"); }

void creaImageIO::GimmickView::SetMessage ( std::string  mess  )  [inline, inherited]

Obtains the message of the state.

Definition at line 151 of file creaImageIOGimmickView.h.

References creaImageIO::GimmickView::mMess.

Referenced by creaImageIO::GimmickView::NoValidateSelected(), and creaImageIO::GimmickView::ValidateSelected().

{mMess=mess;}

Here is the caller graph for this function:

virtual void creaImageIO::GimmickView::ShowHelp (  )  [protected, virtual, inherited]

Shows the help.

void creaImageIO::WxGimmickView::StartListeningThread (  ) 

Starts the listening thread on the CD/DVD drive.

Definition at line 1117 of file creaImageIOWxGimmickView.cpp.

Referenced by creaImageIO::WxListenerPanel::OnChangeThreadState().

          {  

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::StopListeningThread (  ) 

Stops the listening thread on the CD/DVD drive.

Definition at line 1124 of file creaImageIOWxGimmickView.cpp.

References mGimmick, mNotebook, and creaImageIO::GimmickView::UpdateTreeViewLevel().

Referenced by creaImageIO::WxListenerPanel::OnChangeThreadState().

          {  
                  mGimmick->DeleteDrive(drive);
                  UpdateTreeViewLevel(crea::wx2std(mNotebook->GetPageText(mNotebook->GetSelection())),1);

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::StopPlayer (  )  [inline]

Stops the player.

Definition at line 73 of file creaImageIOWxGimmickView.h.

References mViewer, and creaImageIO::WxViewer::StopPlayer().

{mViewer->StopPlayer();}

Here is the call graph for this function:

void creaImageIO::GimmickView::stopReader (  )  [inherited]

Definition at line 299 of file creaImageIOGimmickView.cpp.

References creaImageIO::GimmickView::mReader, and creaImageIO::MultiThreadImageReader::Stop().

Referenced by creaImageIO::GimmickView::ReadImagesNotThreaded().

  {
          mReader.Stop();
  }

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void creaImageIO::GimmickView::UpdateDicomDatabaseView ( DicomDatabase *   )  [inline, protected, virtual, inherited]

Recursively updates the part of the view corresponding to the DicomDatabase passed i.e. creates items for the DicomNode which do not have deletes obsolete items (whose DicomNode has been deleted)

Definition at line 102 of file OldcreaImageIOGimmickView.h.

{ return; }

virtual void creaImageIO::GimmickView::UpdateDicomNodeView ( DicomNode *  n,
const TreeItemId &  parent 
) [inline, protected, virtual, inherited]

Recursively updates the part of the view corresponding to the DicomNode provided. parent is its parent in the tree (where to insert / remove it)

Definition at line 106 of file OldcreaImageIOGimmickView.h.

{ return; }

void creaImageIO::GimmickView::UpdateTreeViewLevel ( const std::string &  t,
int  l 
) [virtual, inherited]

Updates the TreeView of given name from level l to bottom (calls the virtual method TreeView::UpdateLevel(l))

Updates the TreeView of given name from level l to bottom (calls the virtual method TreeView::Update())

Definition at line 142 of file creaImageIOGimmickView.cpp.

References creaImageIO::GimmickView::GetTreeViewMap(), and GimmickError.

Referenced by StopListeningThread().

  {
    TreeViewMapType::iterator i;
    i = GetTreeViewMap().find(t);
    if ( i == GetTreeViewMap().end() )
      {
        GimmickError("INTERNAL ERROR : GimmickView::UpdateTreeView : '"
                     <<t<<"' is not in TreeViewMap");
      }
    i->second->UpdateLevel(l);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::WxGimmickView::UpdateWindowUI ( long  flags = wxUPDATE_UI_NONE  )  [private]

Definition at line 764 of file creaImageIOWxGimmickView.cpp.

References mConstructed, and mViewer.

   {
     if (!mConstructed) return;
     static bool first_time = true;
     if (false)
     {
       first_time = false;

bool creaImageIO::GimmickView::ValidateSelected ( tree::Node sel,
int  min_dim,
int  max_dim 
) [inherited]

Validates the dimension compliance of the images with the maximum and minimum given, and between their sizes.

Validates the dimension compliance of the images with the maximum and minimum given, and between their sizes

Definition at line 209 of file creaImageIOGimmickView.cpp.

References GimmickDebugMessage, creaImageIO::GimmickView::mImageExtent, creaImageIO::GimmickView::modifyValidationSignal(), creaImageIO::GimmickView::SetMessage(), and creaImageIO::GimmickView::valid.

  {
        GimmickDebugMessage(2,"Validating selected"<<std::endl);
        std::string mMessage;
        
        if(sel==0)
        {
                mMessage="Cannot have 0 images selected!";
                valid=false;
        }
        else
        {
                        boost::shared_ptr<ImageExtent> ie=boost::shared_ptr<ImageExtent>(new ImageExtent((*sel).GetAttribute("D0028_0010"),
                                                                        (*sel).GetAttribute("D0028_0011"),
                                                                        (*sel).GetAttribute("D0028_0012"), 
                                                                        ""));

        if(mImageExtent==0)
        {
                mImageExtent=ie;
                if((mImageExtent->Get(min_dim-1)<2)||(mImageExtent->Get(max_dim)>1))
                {
                        valid=false;
                }
                else
                {
                        std::stringstream out;
                        out << mImageExtent->GetDimension() << "D image " << mImageExtent->Get(0) << "x"<< mImageExtent->Get(1) << "x"<< mImageExtent->Get(2) <<" selected";
                        mMessage = out.str();
                        mImageExtent->SetDimension(2);
                        valid=true;
                }
        }
        else
        {
                if(mImageExtent->IsCompatible(*ie))
                {
                        if(mImageExtent->GetDimension()==max_dim && mImageExtent->Get(max_dim)>2)
                        {
                                std::stringstream out;
                                out<<"Cannot add this image to selection : would result in a "<<mImageExtent->GetDimension()+1<<"D image!";
                                mMessage=out.str();
                                valid=false;
                        }
                        else if(max_dim<3)
                        {
                                std::stringstream out;
                                out<<"Selecting "<<mImageExtent->GetDimension()<<"D images is not allowed !";
                                mMessage=out.str();
                                valid=false;
                        }
                        else if(min_dim==3 && (ie->Get(2)+mImageExtent->Get(2))<2)
                        {
                                std::stringstream out;
                                out << "Cannot build the selection as it would result in a ";
                                out << mImageExtent->GetDimension();
                                out << "D image, and the minimum is ";
                                out << min_dim;
                                out << "D!";
                                mMessage=out.str();
                                valid=false;
                        }
                        else
                        {
                                mImageExtent->Add(*ie);
                                std::stringstream out;
                                out << mImageExtent->GetDimension() << "D image " << mImageExtent->Get(0) << "x"<< mImageExtent->Get(1) << "x"<< mImageExtent->Get(2) <<" selected";
                                mMessage = out.str();
                        }
                }
                else
                {
                        mMessage="The selected images are not compatible.";
                        valid=false;
                }
          }
        }

        modifyValidationSignal(valid);
        SetMessage(mMessage);
        return valid;
  }

Here is the call graph for this function:


Friends And Related Function Documentation

MultiThreadImageReader [friend, inherited]

Definition at line 29 of file creaImageIOMultiThreadImageReader.h.

ThreadedImageReader [friend, inherited]

Reimplemented in creaImageIO::MultiThreadImageReader.

Definition at line 28 of file creaImageIOMultiThreadImageReader.h.


Member Data Documentation

Definition at line 36 of file creaImageIOWxGimmickView.h.

Definition at line 125 of file creaImageIOWxGimmickView.h.

Referenced by WxGimmickView().

Definition at line 143 of file creaImageIOWxGimmickView.h.

Referenced by WxGimmickView().

Is set to true at the end of constructor (in order to lock callbacks from threaded objects or event before everything is ok)

Definition at line 130 of file creaImageIOWxGimmickView.h.

Referenced by UpdateWindowUI().

Currently Displayed Node.

Definition at line 234 of file creaImageIOWxGimmickView.h.

Definition at line 242 of file creaImageIOWxGimmickView.h.

Referenced by WxGimmickView().

boost::shared_ptr<Gimmick> creaImageIO::WxGimmickView::mGimmick [private]

Controller which manages the interaction with the model.

Reimplemented from creaImageIO::GimmickView.

Definition at line 151 of file creaImageIOWxGimmickView.h.

Referenced by AddDir(), OnAddDB(), StopListeningThread(), and WxGimmickView().

wxImageList* creaImageIO::WxGimmickView::mIcon [private]

The list of icons.

Definition at line 148 of file creaImageIOWxGimmickView.h.

Referenced by CreateToolBar(), and OnAddFiles().

Definition at line 153 of file creaImageIOWxGimmickView.h.

Referenced by CreateEditFieldsDialog().

wxProgressDialog* creaImageIO::WxGimmickView::mProgressDialog [private]

Progress dialog.

Definition at line 222 of file creaImageIOWxGimmickView.h.

The selection's maximum dimension.

Definition at line 225 of file creaImageIOWxGimmickView.h.

Referenced by WxGimmickView().

The selection's minimum dimension.

Definition at line 228 of file creaImageIOWxGimmickView.h.

Referenced by WxGimmickView().

wxBoxSizer* creaImageIO::WxGimmickView::msizer [private]

Definition at line 126 of file creaImageIOWxGimmickView.h.

Referenced by WxGimmickView().

wxSplitterWindow* creaImageIO::WxGimmickView::mSplitter [private]

Definition at line 142 of file creaImageIOWxGimmickView.h.

Referenced by WxGimmickView().

Definition at line 187 of file creaImageIOWxGimmickView.h.

Referenced by OnAddDB().

wxStaticText* creaImageIO::WxGimmickView::mText [private]

Definition at line 144 of file creaImageIOWxGimmickView.h.

Referenced by WxGimmickView().

wxToolBarToolBase* creaImageIO::WxGimmickView::mToolAddDatabase [private]

Definition at line 136 of file creaImageIOWxGimmickView.h.

wxToolBarToolBase* creaImageIO::WxGimmickView::mToolAddDir [private]

Definition at line 134 of file creaImageIOWxGimmickView.h.

wxToolBarToolBase* creaImageIO::WxGimmickView::mToolAddFile [private]

Definition at line 133 of file creaImageIOWxGimmickView.h.

The ToolBar and the tools.

Definition at line 132 of file creaImageIOWxGimmickView.h.

Referenced by WxGimmickView().

wxToolBarToolBase* creaImageIO::WxGimmickView::mToolHelp [private]

Definition at line 137 of file creaImageIOWxGimmickView.h.

wxToolBarToolBase* creaImageIO::WxGimmickView::mToolRemove [private]

Definition at line 135 of file creaImageIOWxGimmickView.h.

wxToolBarToolBase* creaImageIO::WxGimmickView::mToolSettings [private]

Definition at line 139 of file creaImageIOWxGimmickView.h.

wxToolBarToolBase* creaImageIO::WxGimmickView::mToolSynchronize [private]

Definition at line 138 of file creaImageIOWxGimmickView.h.

wxToolBarToolBase* creaImageIO::WxGimmickView::mToolTools [private]

Definition at line 140 of file creaImageIOWxGimmickView.h.

Image previewer.

Reimplemented from creaImageIO::GimmickView.

Definition at line 231 of file creaImageIOWxGimmickView.h.

Referenced by ClearSelection(), CreateToolBar(), OnRemove(), StopPlayer(), UpdateWindowUI(), and WxGimmickView().

std::vector< boost::shared_ptr<ImagePointerHolder> > creaImageIO::WxGimmickView::pointers [private]

Definition at line 237 of file creaImageIOWxGimmickView.h.

Referenced by OnRemove(), and WxGimmickView().


The documentation for this class was generated from the following files: