}
if (vm.count("file")) {
std::vector<std::string> files=vm["file"].as< vector<string> >();
- cout << "Include paths are: " << vm["file"].as< vector<string> >().front() << "\n";
g.AddFiles(handler,files);
}
if (vm.count("dir")) {
std::vector<std::string> dirs=vm["dir"].as< vector<string> >();
- g.AddDir(handler,dirs.front(), vm.count("recurse"));
+ g.AddDir(handler,dirs.front(), vm.count("recurse"));
}
g.Finalize();
}
//======================================================================
///Reads Images (Non Threaded)
- void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s,std::vector<tree::Node*> im, int dimension)
+ void GimmickView::ReadImagesNotThreaded(std::vector<vtkImageData*>& s,std::vector<std::string> im, int dimension)
{
// Create the output data
// Only one image : give it
vtkImageData* out = vtkImageData::New();
- GimmickMessage(1, "State Check: Full Filename: "
- <<im.front()->GetAttribute("FullFileName")
+ GimmickDebugMessage(3, "State Check: Full Filename: "
+ <<im.front()
<<std::endl);
- out->ShallowCopy(mReader.GetImage(im.front()->GetAttribute("FullFileName")));
+ out->ShallowCopy(mReader.GetImage(im.front()));
s.push_back( out );
}
else if (im.size()>1)
{
- vtkImageData* first = mReader.GetImage( im.front()->GetAttribute("FullFileName"));
+ vtkImageData* first = mReader.GetImage( im.front());
if (dimension==2)
{
// n2D to 3D
*dim[1];
int slice = 0;
- std::vector<tree::Node*>::iterator it;
- for (it=im.begin(); it!=im.end(); ++it)
+ std::vector<std::string>::iterator it;
+ for (it=im.begin(); it!=im.end(); ++it)
{
//std::cout << "copying slice "<<slice <<std::endl;
- vtkImageData* cur = mReader.GetImage( (*it)->GetAttribute("FullFileName"));
+ vtkImageData* cur = mReader.GetImage( (*it));
void* src = cur->GetScalarPointer(0,0,0);
void* dst = out->GetScalarPointer(0,0,slice);
else
{
// n3D
- std::vector<tree::Node*>::iterator it;
+ std::vector<std::string>::iterator it;
for (it=im.begin(); it!=im.end(); ++it)
{
vtkImageData* out = vtkImageData::New();
- out->ShallowCopy(mReader.GetImage((*it)->GetAttribute("FullFileName")));
+ out->ShallowCopy(mReader.GetImage(*it));
s.push_back(out);
}
}
virtual void GetSelectedFiles(std::vector<std::string>& s)
{ GimmickError("INTERNAL ERROR : GetSelectedFiles not implemented"); }
+
+ virtual void GetImages(int dim, std::vector<std::string> files, std::vector<vtkImageData*>& s)
+ { GimmickError("INTERNAL ERROR : GetImages not implemented"); }
+
virtual void OnSelectionChange(std::vector<tree::Node*>& s, bool isSelection, int selection, bool mProcess)
{ GimmickError("INTERNAL ERROR : OnSelectionChange not implemented"); }
+
virtual void ClearSelection()
{ GimmickError("INTERNAL ERROR : ClearSelection not implemented"); }
///Validates the dimension compliance of the images with the maximum and minimum given, and between their sizes
bool ValidateSelected (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);
+ ///Reads the vector of images, builds it in the dimension required and returns them in the supplied vector.
+ void ReadImagesNotThreaded(std::vector<vtkImageData*>& s,std::vector<std::string> files, int dim);
///Requests the reading of an image with priority and index in the
/// current selection (-1 if not in selection)
void RequestReading(tree::Node* n, int prio, int selection_index , ImagePointerHolder *p);
}
//======================================================================
- /// Returns the selected Images so that they comply with the given parameter(4D)
void WxGimmickView::GetSelectedImages(std::vector<vtkImageData*>& s, int dim)
{
- int level=GetTreeViewMap()["Local database"]->GetNumberOfLevels();
- std::vector<tree::Node*> im=GetTreeViewMap()["Local database"]->GetSelected(level+1);
- ReadImagesNotThreaded(s,im,dim);
+ std::vector<std::string> files;
+ GetTreeViewMap()["Local database"]->GetSelectedAsString(files);
+ ReadImagesNotThreaded(s,files,dim);
}
//======================================================================
- /// Returns the selected Images so that they comply with the given parameter(4D)
void WxGimmickView::GetSelectedFiles(std::vector<std::string>& s)
{
GetTreeViewMap()["Local database"]->GetSelectedAsString(s);
}
+ //======================================================================
+ void WxGimmickView::GetImages(int dim, std::vector<std::string> files, std::vector<vtkImageData*>& s)
+ {
+ ReadImagesNotThreaded(s,files,dim);
+ }
//=================================================
void WxGimmickView::CreateIconList()
{
/// Returns the selected Images so that they comply with the given parameter(4D)
//(overloaded from GimmickView)
void GetSelectedImages(std::vector<vtkImageData*>& s, int dim);
+ /// Returns the images indicated by the filenames in the vector so that they comply with the given parameter(dim)
+ //(overloaded from GimmickView)
+ void GetImages(int dim, std::vector<std::string> files, std::vector<vtkImageData*>& s);
/// Callback called when a selection from a TreeView has changed
//(overloaded from GimmickView)
void OnSelectionChange(std::vector<tree::Node*>& s, bool isSelection, int selection, bool mProcess);