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
381 getImageITK(std::string iIndex,
bool iIsInverted =
false)
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