1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
26 /*=========================================================================
29 Module: $RCSfile: marExperiment.h,v $
31 Date: $Date: 2012/11/15 14:15:31 $
32 Version: $Revision: 1.2 $
34 Copyright: (c) 2002, 2003
37 This software is distributed WITHOUT ANY WARRANTY; without even
38 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
39 PURPOSE. See the above copyright notice for more information.
41 =========================================================================*/
42 #ifndef __MAR__KERNEL__EXPERIMENT__HXX__
43 #define __MAR__KERNEL__EXPERIMENT__HXX__
48 #include "marDynData.h"
49 #include "GestionBifurcations.h"
51 class MAR_KERNEL_EXPORT marExperiment : public marObject
56 marExperiment( marParameters* p = NULL );
59 wxString& getDescription( ) { return( _description ); };
60 void setDescription( wxString& d ) { _description = d; };
62 marDynData* getDynData( ) { return( _dynData ); };
64 void getVOI( int* voi ) { memcpy( voi, _voi, sizeof( int ) * 6 ); };
65 void setVOI( int* voi ) { memcpy( _voi, voi, sizeof( int ) * 6 ); };
67 void initExperiment( kVolume* volume );
69 void setStartPoint( int* sp )
71 setStartPoint( sp[ 0 ], sp[ 1 ], sp[ 2 ] );
74 void setStartPoint( int sx, int sy, int sz );
75 void extractVascularTree( int sens = 1, double *vit=NULL, int cleanLevel=0 );
76 void DeleteAxis ( unsigned int index );
78 // marContour* generateContour( int slice, int x, int y, std::vector< double* >* points);
79 vtkPolyData* generateContour( int slice, int x, int y, std::vector< double* >* points);
81 void applyChangeResolution( );
83 int getNumberOfAxes( )
85 return( _axes.size( ) - 1 );
88 marAxis* getAxis( int i = -1 )
90 return( _axes[ i + 1 ] );
93 void appendAxis( marAxis* ax )
95 _axes.push_back( ax );
101 _axes[ 0 ] = _axes[ i + 1 ];
104 int getQuantStart( ) { return _axes[0]->getStartQuant( );};
105 int getQuantFinish( ) { return _axes[0]->getFinishQuant( );};
108 void prepareQuantification( );
110 marContour* getContour( int i ) { return(_axes[0]->getContour ( i , _dynData->getVolume( ) )); };
111 vtkImageData* getSliceImage( int i ) { return(_axes[0]->getSliceImage ( i , _dynData->getVolume( ) )); };
112 vtkProbeFilter* get3DSlice( int i ) { return(_axes[0]->get3DSlice ( i , _dynData->getVolume( ) )); };
113 vtkPoints* get3Dcontour( int i ) { return(_axes[0]->get3Dcontour ( i , _dynData->getVolume( ) )); };
114 vtkPolyData* get2Dcontour( int i ) { return(_axes[0]->get2Dcontour ( i , _dynData->getVolume( ) )); };
115 vtkPoints* get2DDiameterMin( int i ) { return(_axes[0]->get2DDiameterMin ( i , _dynData->getVolume( ) )); };
116 vtkPoints* get2DDiameterMax( int i ) { return(_axes[0]->get2DDiameterMax ( i , _dynData->getVolume( ) )); };
117 double getTotalLength() { return _axes[0]->getTotalLength() * _dynData->getActualVoxel() ; };
118 double getSubAxisLength() { return _axes[0]->getSubAxisLength() * _dynData->getActualVoxel(); };
119 double getReferenceArea() { return _axes[0]->getReferenceArea( _dynData->getVolume( )); };
120 double getReferenceAverDiam() { return _axes[0]->getReferenceAverDiam( _dynData->getVolume( )); };
122 double getAverageArea(int pIni, int pEnd) {return _axes[0]->getAverageArea(pIni,pEnd, _dynData->getVolume( ) ); };
123 int getNumberOfSlices( ) { return _axes[0]->getNumberOfContours(); };
125 void calculateAxesSignal( );
126 void prepareContourImages( );
128 void ClearContours();
129 void RegenerateAxis();
130 void RegenerateSignal();
131 void RecalculateAxis();
135 void copyFrom( const marObject& from );
137 //Persistence methods.
138 bool save( std::ofstream& os );
139 bool load( std::ifstream& is );
143 wxString _description;
144 marDynData* _dynData;
146 int _startPoint[ 3 ];
148 std::vector< marAxis* > _axes;
151 #endif // __MAR__KERNEL__EXPERIMENT__HXX__