35 #ifndef GoImageProcessor_H
36 #define GoImageProcessor_H
39 #include "QGoIOConfigure.h"
43 #include "vtkSmartPointer.h"
45 #include "itkInvertIntensityImageFilter.h"
47 #include <boost/multi_index_container.hpp>
48 #include <boost/multi_index/member.hpp>
49 #include <boost/multi_index/ordered_index.hpp>
50 #include <boost/multi_index/hashed_index.hpp>
58 class vtkImageAccumulate;
163 std::map< unsigned int, unsigned int>
points;
180 typedef boost::multi_index_container<
182 boost::multi_index::indexed_by<
183 boost::multi_index::ordered_non_unique<
184 boost::multi_index::tag<Index>,
186 boost::multi_index::ordered_non_unique<
187 boost::multi_index::tag<Visibility>,
189 boost::multi_index::hashed_non_unique<
190 boost::multi_index::tag<Name>,
219 friend std::ostream &
operator<<
238 vtkSmartPointer<vtkLookupTable> createLUT(
const double& iRed,
239 const double& iGreen,
241 const double& iAlpha);
249 vtkSmartPointer<vtkLookupTable> getLookuptable(
const std::string& iName)
const;
257 vtkSmartPointer<vtkLookupTable> getLookuptable()
const;
268 vtkSmartPointer<vtkPiecewiseFunction>
269 getOpacityTransferFunction(
const std::string& iName)
const;
276 std::vector<vtkPiecewiseFunction*> getOpacityTransferFunctions();
286 std::vector<double> getColor(
const std::string& iName)
const;
288 void setColor(
const std::string& iName, std::vector<double>& iColor);
290 void setLUTParameters(
const std::string& iName,
int iGamma,
int iMin,
int iMax);
292 std::vector<int> getLUTParameters(
const std::string& iName);
300 std::map<unsigned int, unsigned int> getAlpha(
301 const std::string& iName)
const;
308 void updatePoints(std::string iChannel,
309 std::map< unsigned int, unsigned int> iPointsAlpha);
316 vtkSmartPointer< vtkImageAccumulate>
317 getHistogram(
const std::string& iName)
const;
324 virtual void initTimePoint(
const unsigned int& iTime) = 0;
330 virtual void setTimePoint(
const unsigned int& iTime) = 0;
340 virtual void setDoppler(
const unsigned int& iTime,
341 const unsigned int& iPrevious) = 0;
352 vtkSmartPointer<vtkImageData> getImageBW(
const std::string& iName);
353 vtkSmartPointer<vtkImageData> getImageBW(
const unsigned int& iIndex);
360 vtkSmartPointer<vtkImageData> getImageBW();
367 std::string getChannelName(
const unsigned int& iIndex);
373 std::vector<vtkImageData*> getColoredImages();
379 template<
class PixelType, const
unsigned int VImageDimension >
380 typename itk::Image< PixelType, VImageDimension >::Pointer
383 GoMegaImageStructureMultiIndexContainer::index<Name>::type::iterator it =
384 m_MegaImageContainer.get<
Name >().find(iIndex);
386 assert(it!=m_MegaImageContainer.get<
Name >().end());
391 typedef itk::Image<PixelType, VImageDimension> ImageType;
392 typedef itk::InvertIntensityImageFilter <ImageType> InvertFilterType;
393 typename InvertFilterType::Pointer invertFilter = InvertFilterType::New();
394 invertFilter->SetInput( it->Convert2ITK<PixelType, VImageDimension>() );
395 invertFilter->Update();
397 typename ImageType::Pointer itkImage = invertFilter->GetOutput();
398 itkImage->DisconnectPipeline();
404 return it->Convert2ITK<PixelType, VImageDimension>();
414 vtkSmartPointer<vtkImageData> getVisibleImages();
418 unsigned int* getBoundsTime();
419 unsigned int* getBoundsChannel();
423 unsigned int getNumberOfTimePoints();
424 unsigned int getNumberOfChannels();
426 unsigned int getTimeInterval()
const;
430 unsigned int getDopplerStep();
431 void setDopplerStep(
unsigned int iStep);
432 std::vector<int> getDopplerTime(
unsigned int iTime);
433 void setDopplerMode(
const bool& iEnable,
const unsigned int& iChannel);
434 bool getDopplerMode();
435 unsigned int getDopplerChannel();
436 void setDopplerSize(
int iSize);
437 unsigned int getDopplerSize();
444 void visibilityChanged(std::string iName,
bool iVisibility);
450 unsigned int getNumberOfVisibleChannels();
452 int getMaxThreshold();
463 vtkSmartPointer<vtkImageData> colorImage(vtkSmartPointer<vtkImageData> iImage,
464 vtkSmartPointer<vtkLookupTable> iLUT);
473 unsigned int m_BoundsTime[2];
474 unsigned int m_BoundsChannel[2];
502 this->m_Extent[0] = rhs.
m_Extent[0];
503 this->m_Extent[1] = rhs.
m_Extent[1];
504 this->m_Extent[2] = rhs.
m_Extent[2];
505 this->m_Extent[3] = rhs.
m_Extent[3];
506 this->m_Extent[4] = rhs.
m_Extent[4];
507 this->m_Extent[5] = rhs.
m_Extent[5];
520 #endif // GoImageProcessor_H
void setImage(vtkImageData *iImage)
std::vector< double > color
change color of given structure
boost::multi_index_container< GoMegaImageStructure, boost::multi_index::indexed_by< boost::multi_index::ordered_non_unique< boost::multi_index::tag< Index >, BOOST_MULTI_INDEX_MEMBER(GoMegaImageStructure, unsigned int, Index)>, boost::multi_index::ordered_non_unique< boost::multi_index::tag< Visibility >, BOOST_MULTI_INDEX_MEMBER(GoMegaImageStructure, bool, Visibility)>, boost::multi_index::hashed_non_unique< boost::multi_index::tag< Name >, BOOST_MULTI_INDEX_MEMBER(GoMegaImageStructure, std::string, Name)> >> GoMegaImageStructureMultiIndexContainer
set_visibility(bool iVisibility)
void operator()(GoMegaImageStructure &iStructure)
unsigned int m_CurrentTimePoint
unsigned int m_DopplerSize
GoImageProcessor & operator=(const GoImageProcessor &rhs)
change visibility of given structure
unsigned int m_BoundsTime[2]
set_LUT_Parameters(int iGamma, int iMin, int iMax)
void operator()(GoMegaImageStructure &iStructure)
itk::Image< PixelType, VImageDimension >::Pointer getImageITK(std::string iIndex, bool iIsInverted=false)
get an ITK image (vs vtkImageData) given its index
Convenience structure to store visible image.
void setLUTParameters(int iGamma, int iMin, int iMax)
set_image(vtkImageData *iImage)
unsigned int m_DopplerChannel
unsigned int m_BoundsChannel[2]
unsigned int m_DopplerStep
void set_PointsAlpha(std::map< unsigned int, unsigned int > iAlpha)
GoMegaImageStructureMultiIndexContainer m_MegaImageContainer
void setVisibility(bool iVisibility)
unsigned int m_TimeInterval
set_PointsAlpha(std::map< unsigned int, unsigned int > iPoints)
set_color(std::vector< double > iColor)
void setColor(std::vector< double > iColor)
std::vector< int > m_DopplerTime
std::map< unsigned int, unsigned int > points
Interface between image reader and vtkImageData.
void operator()(GoMegaImageStructure &iStructure)
vtkSmartPointer< vtkImageData > m_Output
change visibility of given structure
void operator()(GoMegaImageStructure &iStructure)
void operator()(GoMegaImageStructure &iStructure)