X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvImageReader.h;h=cbe7d1607e62b63c1bca49cdaeb93fd8cf8ed909;hb=b1f5d6c99d0263700df2ddb2c6d1bf348709cd92;hp=99d302ae385a35f3150dd13877c95350fba656dc;hpb=b29f225c9396ca737ce59bdf0d9ef50a6c1e9bc5;p=clitk.git diff --git a/vv/vvImageReader.h b/vv/vvImageReader.h index 99d302a..cbe7d16 100644 --- a/vv/vvImageReader.h +++ b/vv/vvImageReader.h @@ -25,61 +25,66 @@ #include "vvImage.h" #include "vvConstants.h" -class vvImageReader : public QThread { +class vvImageReader : public itk::LightObject, public QThread { public: - vvImageReader(); - ~vvImageReader(); + typedef vvImageReader Self; + typedef itk::SmartPointer Pointer; + itkNewMacro(Self); - void SetInputFilename(const std::string & filename); - void SetInputFilenames(const std::vector & filenames); + void SetInputFilename(const std::string & filename); + void SetInputFilenames(const std::vector & filenames); - vvImage::Pointer GetOutput() { - return mImage; - } + vvImage::Pointer GetOutput() { + return mImage; + } - std::string GetLastError() { - return mLastError; - } + std::string GetLastError() { + return mLastError; + } - //==================================================================== - // Main function - void Update(); - void Update(LoadedImageType type); - void Update(int dim, std::string InputPixelType, LoadedImageType type); - //void Extract(int dim, std::string InputPixelType, int slice); + void SetSlice(unsigned int i) { mSlice = i; } + + //==================================================================== + // Main function + void Update(); + void Update(LoadedImageType type); + void Update(int dim, std::string InputPixelType, LoadedImageType type); protected: - void run(); - //==================================================================== - std::vector mInputFilenames; - ///Method used to load the image, see vvConstants.h for definition - LoadedImageType mType; - itk::Command::Pointer mObserver; - - std::string mLastError; - - //==================================================================== - template - void UpdateWithDim(std::string inputPixelType); - - //==================================================================== - /*template - void ExtractWithDim(std::string inputPixelType, int slice);*/ - - //==================================================================== - template - void UpdateWithDimAndInputPixelType(); - ///Input dimension and pixel type - int mDim; - std::string mInputPixelType; - - //==================================================================== - void ReadNkiImageTransform(); - void ReadMatImageTransform(); + void run(); + //==================================================================== + std::vector mInputFilenames; + ///Method used to load the image, see vvConstants.h for definition + LoadedImageType mType; + unsigned int mSlice; + itk::Command::Pointer mObserver; + + std::string mLastError; + + //==================================================================== + template + void UpdateWithDim(std::string inputPixelType); + + //==================================================================== + /*template + void ExtractWithDim(std::string inputPixelType, int slice);*/ + + //==================================================================== + template + void UpdateWithDimAndInputPixelType(); + ///Input dimension and pixel type + int mDim; + std::string mInputPixelType; + + //==================================================================== + void ReadNkiImageTransform(); + void ReadMatImageTransform(); private: - vvImage::Pointer mImage; + vvImageReader(); + ~vvImageReader(); + vvImage::Pointer mImage; }; // end class vvImageReader #endif /* end #define CLITKvvImageReader_H */