//#include <map>
#include <vtkImageData.h>
+#include <creaImageIOMultiThreadImageReader.h>
#define GIMMICK_NO_IMAGE_SELECTION 0
#define GIMMICK_2D_IMAGE_SELECTION 2
//=====================================================================
///Abstract class that handles views, attributes and previews (GUI) for Gimmick.
- class GimmickView
+ class GimmickView: public MultiThreadImageReaderUser
{
public:
/// Ctor
- GimmickView(Gimmick* );
+ GimmickView(Gimmick*, int number_of_threads = 0 );
/// Virtual destructor
virtual ~GimmickView();
/// Finalize
virtual void Finalize();
+
///Returns the selected Images and validates to see if they comply with the given parameter(<4D)
vtkImageData* GetSelectedImage(int dim);
///Adds the selected Images to the given vector and validates to see if they comply with the given parameter (4D)
- virtual void GetSelectedImages(std::vector<vtkImageData*>& s, int dim) {}
+ virtual void GetSelectedImages(std::vector<vtkImageData*>& s, int dim)
+ { GimmickError("INTERNAL ERROR : GetSelectedImages not implemented"); }
+
+ virtual void GetSelectedFiles(std::vector<std::string>& s)
+ { GimmickError("INTERNAL ERROR : GetSelectedFiles not implemented"); }
+
+ ///Validates the dimension compliance of the images with the maximum and minimum given, and between their sizes
+ bool ValidateSelected (std::vector<tree::Node*>& sel, int min_dim, int max_dim);
+
+ ///Reads the vector of nodes, builds images in the dimension required and returns them in the supplied vector.
+ void ReadImagesNotThreaded(std::vector<vtkImageData*>& s,std::vector<tree::Node*> im, int dim);
- virtual void GetSelectedFiles(std::vector<std::string>& s) {}
+ ///Obtains the message of the state
+ std::string GetMessage(){return mMess;}
+ ///Obtains the message of the state
+ void SetMessage(std::string mess){mMess=mess;}
/// Create the tree views
void CreateTreeViews();
Gimmick* mGimmick;
/// The views
TreeViewMapType mTreeViewMap;
+ /// The message that results from the validation
+ std::string mMess;
+ /// Multi-thread image reader
+ MultiThreadImageReader mReader;
+
};
// EO class GimmickView