Shapeworks Studio  2.1
Shape analysis software suite
List of all members | Public Slots | Signals | Public Member Functions | Static Public Attributes
Project Class Reference

Representation of a project. More...

#include <Project.h>

+ Inheritance diagram for Project:
+ Collaboration diagram for Project:

Public Slots

void handle_clear_cache ()
 
void handle_new_mesh ()
 
void handle_message (std::string s)
 
void handle_thread_complete ()
 

Signals

void data_changed ()
 signal that the data has changed
 
void update_display ()
 
void message (std::string s)
 

Public Member Functions

 Project (QWidget *parent, Preferences &prefs)
 constructor
 
 ~Project ()
 destructor
 
void set_parent (QWidget *parent)
 set QWidget parent
 
bool save_project (std::string filename, std::string dataDir, std::string cutPlanesFile)
 save project to file
 
bool load_project (QString filename, std::string &planesFile)
 load project from file
 
void load_original_files (std::vector< std::string > file_names)
 get the pointer to the data manager More...
 
void load_groomed_files (std::vector< std::string > file_names, double iso)
 load groomed files
 
void load_groomed_images (std::vector< ImageType::Pointer > images, double iso)
 
bool load_point_files (std::vector< std::string > file_names, bool local)
 load point files
 
bool load_points (std::vector< std::vector< itk::Point< float > > > points, bool local)
 
void set_reconstructed_present (bool b)
 
void remove_shapes (QList< int > list)
 remove shapes
 
QVector< QSharedPointer< Shape > > get_shapes ()
 return all shapes
 
void calculate_reconstructed_samples ()
 
void reset ()
 reset the project
 
QString get_filename ()
 get the filename
 
bool original_present ()
 
bool groomed_present ()
 
bool reconstructed_present ()
 
int get_num_shapes ()
 
QSharedPointer< MeshManagerget_mesh_manager ()
 

Static Public Attributes

static const std::string DATA_C
 
static const std::string GROOM_C
 
static const std::string OPTIMIZE_C
 
static const std::string ANALYSIS_C
 

Detailed Description

Representation of a project.

The Project class encapsulates everything about a project.

Definition at line 22 of file Project.h.

Member Function Documentation

void Project::load_original_files ( std::vector< std::string >  file_names)

get the pointer to the data manager

import files

Definition at line 295 of file Project.cc.

295  {
296  QProgressDialog progress("Loading images...", "Abort", 0, file_names.size(), this->parent_);
297  progress.setWindowModality(Qt::WindowModal);
298  progress.show();
299  progress.setMinimumDuration(2000);
300 
301  for (int i = 0; i < file_names.size(); i++) {
302  progress.setValue(i);
303  QApplication::processEvents();
304  if (progress.wasCanceled()) {
305  break;
306  }
307  QSharedPointer<Shape> new_shape = QSharedPointer<Shape>(new Shape);
308  new_shape->import_original_image(file_names[i], 0.5);
309  if (!this->shapes_.empty()) {
310  auto spacing = this->shapes_[0]->get_original_image()->GetSpacing();
311  auto spacing_new = new_shape->get_original_image()->GetSpacing();
312  if (spacing != spacing_new) {
313  emit data_changed();
314  this->renumber_shapes();
315  this->original_present_ = true;
316  throw std::runtime_error(file_names[i] + " does not match spacing with " +
317  this->shapes_[0]->get_original_filename().toStdString() + "!!!");
318  }
319  auto sizing = this->shapes_[0]->get_original_image()->GetLargestPossibleRegion();
320  auto sizing_new = new_shape->get_original_image()->GetLargestPossibleRegion();
321  if (sizing != sizing_new) {
322  emit data_changed();
323  this->renumber_shapes();
324  this->original_present_ = true;
325  throw std::runtime_error(file_names[i] + " does not match voxel space with " +
326  this->shapes_[0]->get_original_filename().toStdString() + "!!!");
327  }
328  }
329  this->shapes_.push_back(new_shape);
330  }
331  progress.setValue(file_names.size());
332  QApplication::processEvents();
333  this->renumber_shapes();
334  if (file_names.size() > 0) {
335  this->original_present_ = true;
336  emit data_changed();
337  }
338 }
void data_changed()
signal that the data has changed
Representation of a single shape/patient.
Definition: Shape.h:21

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