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

creaImageIO::GimmickView Class Reference
[View]

Abstract class that handles views, attributes and previews (GUI) for Gimmick. More...

#include <creaImageIOGimmickView.h>

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

List of all members.

Classes

struct  ImageEventType

Public Types

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.
enum  EventType {
  ThreadedReaderStarted, ThreadedReaderStopped, ImageLoaded, ImageUnloaded,
  Error, ThreadedReaderStarted, ThreadedReaderStopped, ImageLoaded,
  ImageUnloaded, Error
}
enum  EventType {
  ThreadedReaderStarted, ThreadedReaderStopped, ImageLoaded, ImageUnloaded,
  Error, ThreadedReaderStarted, ThreadedReaderStopped, ImageLoaded,
  ImageUnloaded, Error
}

Public Member Functions

 GimmickView (boost::shared_ptr< Gimmick >, int number_of_threads=0)
 Ctor.
virtual ~GimmickView ()
 Virtual destructor.
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 GetSelectedImagesInVector (std::vector< vtkImageData * > &s, int dim)
 Adds the selected Images to the given vector.
virtual void GetSelectedImages (std::vector< vtkImageData * > &s, int dim)
 Adds the selected Images to the given vector and validates to see if they comply with the given parameter (4D).
virtual void GetSelectedFiles (std::vector< std::string > &s)
virtual void GetImages (int dim, std::vector< std::string > files, std::vector< vtkImageData * > &s)
virtual void OnSelectionChange (const std::vector< tree::Node * > &s, bool isSelection, int selection, bool mProcess)
virtual void ClearSelection ()
virtual void AddIgnoreFile (tree::Node *toRemove)
 Adds a file to ignore.
virtual void CopyFiles (const std::vector< std::string > &filenames)
 Copies selected files.
virtual void CreateEditFieldsDialog (tree::Node *node, std::vector< std::string > names, std::vector< std::string > keys)
 Edits the fields of a given node.
virtual void Anonymize (std::vector< std::string > i_filenames, int type)
 Anonymize or de-anonymize data.
virtual void DumpTags (const std::string filename)
 Display all Dicom Tags.
virtual void ExportToStorage (const std::vector< std::string > keys)
 Edits the fields of a given node.
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 CreateTreeView (TreeHandler *)
 Create the tree view for TreeHandler provided.
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 ()
 GimmickView ()
 Ctor.
virtual ~GimmickView ()
 Virtual destructor.
virtual int GetSelectionSize ()
 Returns the size of the current selection.
virtual bool IsSelectionValid ()
 Returns true if there is a valid selection.
virtual void GetSelectedFiles (std::vector< std::string > &)
 Returns the vector of full filenames of selected images.
virtual void GetSelectedImages (std::vector< vtkImageData * > &)
 Returns the vector of images corresponding to 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 ()

Protected Member Functions

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 Types

typedef void(* readXD )(std::vector< OutStrGimmick > &, std::vector< std::string >, OutputAttr, double)
typedef std::map< std::string,
ImageEventType
ImageEventTypeMap
typedef std::deque
< ImageEventType
ImageEventQueueType
typedef WxGimmickTreeItemData TreeItemData
 Type definition of the data regarding the tree.
typedef WxGimmickDicomNodeData NodeData
 Type definition of the data insid a node of the tree.

Private Member Functions

void getAttributes (const std::string i_file, std::map< std::string, std::string > &o_infos, OutputAttr i_attr)
virtual void readImages2 (std::vector< OutStrGimmick > &o_output, std::vector< std::string > im, OutputAttr i_attr, double i_zspc)
virtual void readImages3 (std::vector< OutStrGimmick > &o_output, std::vector< std::string > im, OutputAttr i_attr, double i_zspc)
virtual void readImages4 (std::vector< OutStrGimmick > &o_output, std::vector< std::string > im, OutputAttr i_attr)
virtual void readImages1 (std::vector< OutStrGimmick > &o_output, std::vector< std::string > im, OutputAttr i_attr)
const std::string & GetDatabaseExtension ()
 Gets the extension of the database.
virtual void SetDatabaseExtension (const std::string &ext)
 Sets the extension of the database.
virtual void ShowImage (vtkImageData *image)
 Shows the image sent as a parameter.
void CreateUserSettingsDirectory ()
 Creates the user settings directory.
const std::string & GetUserSettingsDirectory ()
 Obtains the user settings directory.
virtual void ShowInformation (DicomNode *)
 Shows the Information regarding the node sent as a parameter.
TreeItemDataGetItemData (const TreeItemId &id)
 Gets the item data of the tree item passed as a parameter.

Private Attributes

boost::shared_ptr< GimmickmGimmick
 Controller which manages the interaction with the model.
TreeViewMapType mTreeViewMap
 The views.
std::string mMess
 The message that results from the validation.
MultiThreadImageReader mReader
 Multi-thread image reader.
ImageEventTypeMap mImageEventMap
boost::shared_ptr< ImageExtentmImageExtent
 The current image extent.
ValidationSignalType mValidationSignal
 The validation signal.
bool valid
 Boolean that determines if the selection is valid.
bool mReaderStarted
 Boolean that determines if the reader has been started.
int mSelectionType
int mSelectionMaxImageDimension
int mCurrentSelectionImageSize [4]
DicomDatabaseListType mDicomDatabaseList
 Existent Database List.
DicomDatabase * mFavoriteDatabase
 Favorites database.
std::string mDatabaseListFile
 Path to the database list file.
std::string mDatabaseExtension
 Extension of the database.
bool mJustStarted
int mFirstDicomDatabaseIconIndex
vtkImageViewer2 * mViewer
int mx1
int mx2
int my1
int my2
int mz1
int mz2
double mspx
double mspy
double mspz
std::map< std::string,
DicomNode * > 
mImageFileNameToNode
Gimmickcontroller

Friends

class ThreadedImageReader
class MultiThreadImageReader

Detailed Description

Abstract class that handles views, attributes and previews (GUI) for Gimmick.

Definition at line 54 of file creaImageIOGimmickView.h.


Member Typedef Documentation

typedef std::vector<DicomDatabase*> creaImageIO::GimmickView::DicomDatabaseListType

Type of list of DicomDatabase.

Definition at line 37 of file OldcreaImageIOGimmickView.h.

Definition at line 255 of file creaImageIOGimmickView.h.

typedef std::map<std::string,ImageEventType> creaImageIO::GimmickView::ImageEventTypeMap [private]

Definition at line 249 of file creaImageIOGimmickView.h.

typedef WxGimmickDicomNodeData creaImageIO::GimmickView::NodeData [private]

Type definition of the data insid a node of the tree.

Definition at line 114 of file OldcreaImageIOGimmickView.h.

typedef void(* creaImageIO::GimmickView::readXD)(std::vector< OutStrGimmick > &, std::vector< std::string >, OutputAttr, double) [private]

Definition at line 204 of file creaImageIOGimmickView.h.

typedef WxGimmickTreeItemData creaImageIO::GimmickView::TreeItemData [private]

Type definition of the data regarding the tree.

Definition at line 110 of file OldcreaImageIOGimmickView.h.

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

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

Definition at line 179 of file creaImageIOGimmickView.h.

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

Definition at line 178 of file creaImageIOGimmickView.h.


Member Enumeration Documentation

Enumerator:
ThreadedReaderStarted 
ThreadedReaderStopped 
ImageLoaded 
ImageUnloaded 
Error 
ThreadedReaderStarted 
ThreadedReaderStopped 
ImageLoaded 
ImageUnloaded 
Error 

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 34 of file creaImageIOMultiThreadImageReader.h.

      {
        ThreadedReaderStarted,
        ThreadedReaderStopped,
        ImageLoaded,
        ImageUnloaded,
        Error
      }

Enumerator:
ThreadedReaderStarted 
ThreadedReaderStopped 
ImageLoaded 
ImageUnloaded 
Error 
ThreadedReaderStarted 
ThreadedReaderStopped 
ImageLoaded 
ImageUnloaded 
Error 

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 34 of file creaImageIOQMultiThreadImageReader.h.

      {
        ThreadedReaderStarted,
        ThreadedReaderStopped,
        ImageLoaded,
        ImageUnloaded,
        Error
      }


Constructor & Destructor Documentation

creaImageIO::GimmickView::GimmickView ( boost::shared_ptr< Gimmick gimmick,
int  number_of_threads = 0 
)

Ctor.

Definition at line 75 of file creaImageIOGimmickView.cpp.

References GimmickDebugMessage.

    : mGimmick(gimmick),
          mReader(threads)
  {
    GimmickDebugMessage(1,"GimmickView::GimmickView"
                        <<std::endl);
        // Anciently started the threads ...
    // Threads now automatically start at first image request
    //mReader.Start();

  }

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

Virtual destructor.

Destructor.

Definition at line 90 of file creaImageIOGimmickView.cpp.

References GimmickDebugMessage.

  {
    GimmickDebugMessage(1,"GimmickView::~GimmickView"
                        <<std::endl);
  }

creaImageIO::GimmickView::GimmickView (  ) 

Ctor.

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

Virtual destructor.


Member Function Documentation

virtual void creaImageIO::GimmickView::AddIgnoreFile ( tree::Node toRemove  )  [inline, virtual]

Adds a file to ignore.

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 103 of file creaImageIOGimmickView.h.

References GimmickError.

Referenced by creaImageIO::WxTreeView::RemoveSelected().

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

Here is the caller graph for this function:

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

Anonymize or de-anonymize data.

Definition at line 115 of file creaImageIOGimmickView.h.

References GimmickError.

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

virtual void creaImageIO::GimmickView::ClearSelection (  )  [inline, virtual]

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 99 of file creaImageIOGimmickView.h.

References GimmickError.

Referenced by creaImageIO::WxTreeView::OnItemSelected(), creaImageIO::WxTreeView::OnKeyDown(), and creaImageIO::WxTreeView::OnPopupFilter().

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

Here is the caller graph for this function:

void creaImageIO::GimmickView::ConnectValidationObserver ( ValidationCallbackType  callback  ) 

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 mValidationSignal.

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

  {
    mValidationSignal.connect(callback);
  }       

Here is the caller graph for this function:

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

Copies selected files.

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 107 of file creaImageIOGimmickView.h.

References GimmickError.

Referenced by creaImageIO::WxTreeView::OnLocalCopy().

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

Here is the caller graph for this function:

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

Edits the fields of a given node.

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 111 of file creaImageIOGimmickView.h.

References GimmickError.

Referenced by creaImageIO::WxTreeView::OnEditField().

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

Here is the caller graph for this function:

void creaImageIO::GimmickView::CreateSingleTreeView ( std::string &  i_name  ) 

Create a tree view with a given name.

Definition at line 130 of file creaImageIOGimmickView.cpp.

References CreateTreeView(), and mGimmick.

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

Here is the call graph for this function:

virtual void creaImageIO::GimmickView::CreateTreeView ( TreeHandler  )  [inline, virtual]

Create the tree view for TreeHandler provided.

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 163 of file creaImageIOGimmickView.h.

References GimmickError.

Referenced by CreateSingleTreeView(), and CreateTreeViews().

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

Here is the caller graph for this function:

void creaImageIO::GimmickView::CreateTreeViews (  ) 

Create the tree views.

Definition at line 117 of file creaImageIOGimmickView.cpp.

References CreateTreeView(), GimmickMessage, and mGimmick.

Referenced by creaImageIO::WxGimmickView::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::GimmickView::CreateUserSettingsDirectory (  )  [inline, private]

Creates the user settings directory.

Definition at line 77 of file OldcreaImageIOGimmickView.h.

{ return; }

virtual void creaImageIO::GimmickView::DumpTags ( const std::string  filename  )  [inline, virtual]

Display all Dicom Tags.

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 119 of file creaImageIOGimmickView.h.

References GimmickError.

Referenced by creaImageIO::WxTreeView::OnDumpTags().

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

Here is the caller graph for this function:

virtual void creaImageIO::GimmickView::ExportToStorage ( const std::vector< std::string >  keys  )  [inline, virtual]

Edits the fields of a given node.

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 123 of file creaImageIOGimmickView.h.

References GimmickError.

Referenced by creaImageIO::WxTreeView::OnExportToStorage().

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

Here is the caller graph for this function:

void creaImageIO::GimmickView::Finalize (  )  [virtual]

Finalize.

Definition at line 109 of file creaImageIOGimmickView.cpp.

  {
  }

void creaImageIO::GimmickView::getAttributes ( const std::string  i_file,
std::map< std::string, std::string > &  o_infos,
OutputAttr  i_attr 
) [private]

Definition at line 439 of file creaImageIOGimmickView.cpp.

References creaImageIO::MultiThreadImageReader::getAttributes(), creaImageIO::OutputAttr::inside, mGimmick, mReader, and creaImageIO::OutputAttr::outside.

Referenced by readImages1(), readImages2(), readImages3(), and readImages4().

        {
                if(i_attr.inside.size() >0)
                {
                        mGimmick->GetAttributes(i_file,o_infos,i_attr);
                }
                if(i_attr.outside.size()>0)
                {
                        mReader.getAttributes(i_file,o_infos, i_attr.outside);
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

const std::string& creaImageIO::GimmickView::GetDatabaseExtension (  )  [inline, private]

Gets the extension of the database.

Definition at line 53 of file OldcreaImageIOGimmickView.h.

{ return null; }

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

Definition at line 175 of file creaImageIOGimmickView.h.

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

Referenced by OnMultiThreadImageReaderEvent(), creaImageIO::WxGimmickView::OnRemove(), and creaImageIO::WxGimmickView::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]

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]

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]

Returns the DicomNode corresponding to the tree item.

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

Definition at line 93 of file creaImageIOGimmickView.h.

References GimmickError.

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

TreeItemData* creaImageIO::GimmickView::GetItemData ( const TreeItemId &  id  )  [inline, private]

Gets the item data of the tree item passed as a parameter.

Definition at line 112 of file OldcreaImageIOGimmickView.h.

{ return null; }

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

Returns the maximal priority.

Definition at line 80 of file creaImageIOGimmickView.h.

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

{return mReader.GetMaximalPriority();}

Here is the call graph for this function:

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

Obtains the message of the state.

Definition at line 148 of file creaImageIOGimmickView.h.

References mMess.

{return mMess;}

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

Returns the vector of DicomNode corresponding to selection.

Definition at line 31 of file OldcreaImageIOGimmickView.h.

{ return; }

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

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 90 of file creaImageIOGimmickView.h.

References GimmickError.

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

virtual void creaImageIO::GimmickView::GetSelectedFiles ( std::vector< std::string > &   )  [inline, virtual]

Returns the vector of full filenames of selected images.

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 27 of file OldcreaImageIOGimmickView.h.

{ return; }

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

Returns the vector of images corresponding to selection.

Definition at line 29 of file OldcreaImageIOGimmickView.h.

{ return; }

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

Adds the selected Images to the given vector and validates to see if they comply with the given parameter (4D).

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 87 of file creaImageIOGimmickView.h.

References GimmickError.

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

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

Adds the selected Images to the given vector.

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 83 of file creaImageIOGimmickView.h.

References GimmickError.

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

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

Returns the size of the current selection.

Definition at line 23 of file OldcreaImageIOGimmickView.h.

{ return 0; } 

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

Returns the TreeViewMap (const ref).

Definition at line 73 of file creaImageIOGimmickView.h.

References mTreeViewMap.

      { return mTreeViewMap; }

const std::string& creaImageIO::GimmickView::GetUserSettingsDirectory (  )  [inline, private]

Obtains the user settings directory.

Definition at line 79 of file OldcreaImageIOGimmickView.h.

{ return null; }

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

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

Definition at line 101 of file creaImageIOGimmickView.cpp.

References mReaderStarted.

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

  {
        mReaderStarted=false;
  }

Here is the caller graph for this function:

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

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  ) 

Definition at line 419 of file creaImageIOGimmickView.cpp.

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

Referenced by 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:

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

Loads or creates a favorites database.

Definition at line 74 of file OldcreaImageIOGimmickView.h.

{ return; }

void creaImageIO::GimmickView::modifyValidationSignal ( bool  ivalid  ) 

Definition at line 293 of file creaImageIOGimmickView.cpp.

References mValidationSignal.

Referenced by NoValidateSelected(), creaImageIO::WxTreeView::RemoveSelected(), and ValidateSelected().

  {

          mValidationSignal(ivalid);
  }

Here is the caller graph for this function:

void creaImageIO::MultiThreadImageReaderUser::MultiThreadImageReaderEventLock (  )  [inline, 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::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 (  ) 

No selected image.

Definition at line 195 of file creaImageIOGimmickView.cpp.

References GimmickDebugMessage, modifyValidationSignal(), SetMessage(), and 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:

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

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, GetDefaultImage(), GimmickDebugMessage, GimmickMessage, creaImageIO::GimmickView::ImageEventType::image, creaImageIO::MultiThreadImageReaderUser::ImageLoaded, creaImageIO::MultiThreadImageReaderUser::ImageUnloaded, 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:

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

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 96 of file creaImageIOGimmickView.h.

References GimmickError.

Referenced by creaImageIO::WxTreeView::ValidateSelectedImages().

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

Here is the caller graph for this function:

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

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 
)

Definition at line 622 of file creaImageIOGimmickView.cpp.

References isSingle(), readImages1(), readImages2(), readImages3(), and 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::readImages1 ( std::vector< OutStrGimmick > &  o_output,
std::vector< std::string >  im,
OutputAttr  i_attr 
) [private, virtual]

Definition at line 454 of file creaImageIOGimmickView.cpp.

References getAttributes(), creaImageIO::MultiThreadImageReader::GetImage(), creaImageIO::OutStrGimmick::img, creaImageIO::OutStrGimmick::infos, mReader, and creaImageIO::OutputAttr::mult.

Referenced by readImages().

        {
                std::vector<std::string>::iterator it;
                for (it=im.begin(); it!=im.end(); ++it)
                {
                        OutStrGimmick out;
                        out.img = vtkImageData::New();
                        out.img->ShallowCopy(mReader.GetImage(*it));
                        if(i_attr.mult)
                                getAttributes((*it),out.infos,i_attr);
                        o_output.push_back(out);
                }
                // If we want only one output information structure, we set it outside the loop
                if(!i_attr.mult)
                {
                        getAttributes(im.front(), o_output.front().infos, i_attr);
                }
                
        }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::GimmickView::readImages2 ( std::vector< OutStrGimmick > &  o_output,
std::vector< std::string >  im,
OutputAttr  i_attr,
double  i_zspc 
) [private, virtual]

Definition at line 526 of file creaImageIOGimmickView.cpp.

References getAttributes(), creaImageIO::MultiThreadImageReader::GetImage(), creaImageIO::OutStrGimmick::img, mReader, and creaImageIO::OutputAttr::mult.

Referenced by readImages().

        {
                vtkImageData* first = mReader.GetImage( im.front());
                int dim[3];
                first->GetDimensions(dim);
                // differents formats char , short, etc...
                // differents components 1..3  ex. jpg ->RGB 3
                unsigned long imsize = dim[0] * dim[1];
                imsize = imsize * first->GetScalarSize() * first->GetNumberOfScalarComponents();

                // Order the file name vector already did with the OutputModel!!!
                std::vector<std::string>::iterator it;
                std::vector<OutStrGimmick>::iterator it_out = o_output.begin();

                for (it=im.begin(); it!=im.end(); ++it, it_out += dim[2])
                {
                        vtkImageData* cur = mReader.GetImage( (*it) );
                        for (int slice= 0 ; slice <dim[2]; slice++)
                        {
                                OutStrGimmick out;
                                out.img = vtkImageData::New();
                                out.img->SetScalarType(first->GetScalarType());

                                out.img->SetNumberOfScalarComponents(first->GetNumberOfScalarComponents());
                                int ext[6];
                                first->GetWholeExtent(ext);  // send also 0,0 in Z 
                                ext[5] = 0;
                                out.img->SetExtent(ext);

                                out.img->SetDimensions(dim[0], dim[1], 1 );
                                out.img->AllocateScalars();
                                out.img->Update();
                                memcpy(out.img->GetScalarPointer(0,0,0), cur->GetScalarPointer(0,0,slice), imsize);
                                o_output.push_back(out);
                        }
                        if(i_attr.mult)
                                getAttributes((*it),(*it_out).infos,i_attr);
                }
                if(!i_attr.mult)
                {
                        getAttributes(im.front(), o_output.front().infos,i_attr);
                }

        }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::GimmickView::readImages3 ( std::vector< OutStrGimmick > &  o_output,
std::vector< std::string >  im,
OutputAttr  i_attr,
double  i_zspc 
) [private, virtual]

!!!out.img->SetSpacing(i_zspc);

Definition at line 478 of file creaImageIOGimmickView.cpp.

References getAttributes(), creaImageIO::MultiThreadImageReader::GetImage(), creaImageIO::OutStrGimmick::img, creaImageIO::OutStrGimmick::infos, and mReader.

Referenced by readImages().

        {
                OutStrGimmick out;
                vtkImageData* first = mReader.GetImage( im.front());
                out.img  = vtkImageData::New();
                out.img->SetScalarType(first->GetScalarType());
                out.img->SetNumberOfScalarComponents(first->GetNumberOfScalarComponents());
                int ext[6];
                first->GetWholeExtent(ext);  // send also 0,0 in Z 
                if(ext[5] == 0)
                {
                        ext[5] = im.size()-1;
                }
                else
                {
                        ext[5] = ext[5] * im.size()-1; // to deal with multiframes 
                }
                out.img->SetExtent(ext);
                int dim[3];
                first->GetDimensions(dim);
                out.img->SetDimensions(dim[0], dim[1], im.size() );
                out.img->AllocateScalars();
                out.img->Update();
                unsigned long imsize = dim[0] * dim[1];
                imsize = imsize * dim[2] ;  // deal with multiframes here
                // differents formats char , short, etc...
                // differents components 1..3  ex. jpg ->RGB 3
                imsize = imsize * first->GetScalarSize() * first->GetNumberOfScalarComponents();
                // Order the file name vector already did with the OutputModel!!!
                int slice = 0;
                std::vector<std::string>::iterator it;
                for (it=im.begin(); it!=im.end(); ++it) 
                {
                        vtkImageData* cur = mReader.GetImage( (*it) );
                        memcpy(out.img->GetScalarPointer(0,0,slice), cur->GetScalarPointer(0,0,0), imsize);
                        slice++;
                }       
                getAttributes(im.front(),out.infos, i_attr);
                o_output.push_back(out);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::GimmickView::readImages4 ( std::vector< OutStrGimmick > &  o_output,
std::vector< std::string >  im,
OutputAttr  i_attr 
) [private, virtual]

Definition at line 575 of file creaImageIOGimmickView.cpp.

References getAttributes(), creaImageIO::MultiThreadImageReader::GetImage(), creaImageIO::OutStrGimmick::img, mReader, and creaImageIO::OutputAttr::mult.

Referenced by readImages().

        {
                std::vector<std::string>::iterator it;
                std::vector<OutStrGimmick>::iterator it_out = o_output.begin();
                vtkImageData* first = mReader.GetImage( im.front());
                int dim[3];
                first->GetDimensions(dim);
                        
                for (int slice= 0 ; slice <dim[2]; slice++)
                {
                        OutStrGimmick out;
                        out.img = vtkImageData::New();
                        out.img->SetScalarType(first->GetScalarType());
                        out.img->SetNumberOfScalarComponents(first->GetNumberOfScalarComponents());
                        
                        int ext[6];
                        first->GetWholeExtent(ext);  // send also 0,0 in Z 
                        ext[5] = 0;
                        out.img->SetExtent(ext);
                        
                        out.img->SetDimensions(dim[0], dim[1], im.size() );
                        out.img->AllocateScalars();
                        out.img->Update();
                        unsigned long imsize = dim[0] * dim[1];
                        imsize = imsize * first->GetScalarSize() * first->GetNumberOfScalarComponents();
                        int index = 0;
        
                        for (it=im.begin(); it!=im.end(); ++it, index ++)
                        {
                                vtkImageData* cur = mReader.GetImage( (*it) );
                                memcpy(out.img->GetScalarPointer(0,0,index), cur->GetScalarPointer(0,0,slice), imsize);
                                o_output.push_back(out);
                        }
                }
                if(!i_attr.mult) // No sense to take informations in all images
                {
                        getAttributes(im.front(), o_output.front().infos,i_attr);
                }

        }

Here is the call graph for this function:

Here is the caller graph for this function:

void creaImageIO::GimmickView::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.

Reads Images (Non Threaded).

Definition at line 306 of file creaImageIOGimmickView.cpp.

References creaImageIO::MultiThreadImageReader::GetImage(), mReader, and 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 
)

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 mReader.

Referenced by creaImageIO::WxGimmickView::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:

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

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 
)

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(), mImageEventMap, mReader, 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 (  ) 

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 mImageExtent, and valid.

Referenced by creaImageIO::WxGimmickView::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]

Copies selected files.

Definition at line 127 of file creaImageIOGimmickView.h.

References GimmickError.

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

virtual void creaImageIO::GimmickView::SetDatabaseExtension ( const std::string &  ext  )  [inline, private, virtual]

Sets the extension of the database.

Definition at line 55 of file OldcreaImageIOGimmickView.h.

{ return; }

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

Obtains the message of the state.

Definition at line 151 of file creaImageIOGimmickView.h.

References mMess.

Referenced by NoValidateSelected(), and ValidateSelected().

{mMess=mess;}

Here is the caller graph for this function:

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

Shows the help.

virtual void creaImageIO::GimmickView::ShowImage ( vtkImageData *  image  )  [inline, private, virtual]

Shows the image sent as a parameter.

Definition at line 65 of file OldcreaImageIOGimmickView.h.

{ return; }

virtual void creaImageIO::GimmickView::ShowInformation ( DicomNode *   )  [inline, private, virtual]

Shows the Information regarding the node sent as a parameter.

Definition at line 88 of file OldcreaImageIOGimmickView.h.

{ return; }

void creaImageIO::GimmickView::stopReader (  ) 

Definition at line 299 of file creaImageIOGimmickView.cpp.

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

Referenced by 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]

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]

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]

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 GetTreeViewMap(), and GimmickError.

Referenced by creaImageIO::WxGimmickView::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:

bool creaImageIO::GimmickView::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.

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, mImageExtent, modifyValidationSignal(), SetMessage(), and 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 153 of file OldcreaImageIOGimmickView.h.

Definition at line 124 of file OldcreaImageIOGimmickView.h.

Extension of the database.

Definition at line 134 of file OldcreaImageIOGimmickView.h.

Path to the database list file.

Definition at line 132 of file OldcreaImageIOGimmickView.h.

Existent Database List.

Definition at line 127 of file OldcreaImageIOGimmickView.h.

Favorites database.

Definition at line 129 of file OldcreaImageIOGimmickView.h.

Definition at line 138 of file OldcreaImageIOGimmickView.h.

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

Controller which manages the interaction with the model.

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 222 of file creaImageIOGimmickView.h.

Referenced by CreateSingleTreeView(), CreateTreeViews(), and getAttributes().

Map of images' names to ImageEventType Used to associated a filename to a the data of a request

Definition at line 252 of file creaImageIOGimmickView.h.

Referenced by OnMultiThreadImageReaderEvent(), and RequestReading().

The current image extent.

Definition at line 260 of file creaImageIOGimmickView.h.

Referenced by ResetExtent(), and ValidateSelected().

std::map<std::string,DicomNode*> creaImageIO::GimmickView::mImageFileNameToNode [private]

Definition at line 150 of file OldcreaImageIOGimmickView.h.

Definition at line 136 of file OldcreaImageIOGimmickView.h.

std::string creaImageIO::GimmickView::mMess [private]

The message that results from the validation.

Definition at line 228 of file creaImageIOGimmickView.h.

Referenced by GetMessage(), and SetMessage().

Boolean that determines if the reader has been started.

Definition at line 269 of file creaImageIOGimmickView.h.

Referenced by Initialize(), and RequestReading().

Definition at line 123 of file OldcreaImageIOGimmickView.h.

Definition at line 122 of file OldcreaImageIOGimmickView.h.

Definition at line 144 of file OldcreaImageIOGimmickView.h.

Definition at line 144 of file OldcreaImageIOGimmickView.h.

Definition at line 144 of file OldcreaImageIOGimmickView.h.

The views.

Definition at line 225 of file creaImageIOGimmickView.h.

Referenced by GetTreeViewMap().

The validation signal.

Definition at line 263 of file creaImageIOGimmickView.h.

Referenced by ConnectValidationObserver(), and modifyValidationSignal().

vtkImageViewer2* creaImageIO::GimmickView::mViewer [private]

Reimplemented in creaImageIO::WxGimmickView.

Definition at line 141 of file OldcreaImageIOGimmickView.h.

Definition at line 143 of file OldcreaImageIOGimmickView.h.

Definition at line 143 of file OldcreaImageIOGimmickView.h.

Definition at line 143 of file OldcreaImageIOGimmickView.h.

Definition at line 143 of file OldcreaImageIOGimmickView.h.

Definition at line 143 of file OldcreaImageIOGimmickView.h.

Definition at line 143 of file OldcreaImageIOGimmickView.h.

Boolean that determines if the selection is valid.

Definition at line 266 of file creaImageIOGimmickView.h.

Referenced by NoValidateSelected(), ResetExtent(), and ValidateSelected().


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