source: branches/4.0.0/components/native/itk-plugin/itkBioFormatsImageIO.h @ 4879

Revision 4879, 2.7 KB checked in by melissa, 11 years ago (diff)

Synced 4.0.0 branch to r4878 (including r4804).

Line 
1//
2// itkBioFormatsImageIO.h
3//
4
5/*
6OME Bio-Formats package for reading and converting biological file formats.
7Copyright (C) 2005-@year@ UW-Madison LOCI and Glencoe Software, Inc.
8
9This program is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 3 of the License, or
12(at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22*/
23
24/*
25Adapted from the Slicer3 project: http://www.slicer.org/
26http://viewvc.slicer.org/viewcvs.cgi/trunk/Libs/MGHImageIO/
27
28See slicer-license.txt for Slicer3's licensing information.
29
30For more information about the ITK Plugin IO mechanism, see:
31http://www.itk.org/Wiki/Plugin_IO_mechanisms
32*/
33
34#ifndef H_ITK_IMAGE_IO_H
35#define H_ITK_IMAGE_IO_H
36
37// STL includes
38
39// ITK includes
40#include "itkImageIOBase.h"
41#include "itkMatrix.h"
42
43#include <itk_zlib.h>
44
45//#include "itkBioFormatsIOWin32Header.h"
46
47#include "bioformats.h"
48
49// for debugging
50#define BF_ITK_DEBUG
51#ifdef BF_ITK_DEBUG
52#define PRINT(x) \
53  std::cout << x << std::endl;
54#else
55#define PRINT(x)
56#endif
57
58namespace itk
59{
60
61  class  BioFormatsImageIO : public ImageIOBase
62  {
63  public:
64    typedef BioFormatsImageIO       Self;
65    typedef ImageIOBase             Superclass;
66    typedef SmartPointer<Self>      Pointer;
67
68    /** Method for creation through the object factory **/
69    itkNewMacro(Self);
70    /** RTTI (and related methods) **/
71    itkTypeMacro(BioFormatsImageIO, Superclass);
72
73    /**--------------- Read the data----------------- **/
74    virtual bool CanReadFile(const char* FileNameToRead);
75    /* Set the spacing and dimension information for the set file name */
76    virtual void ReadImageInformation();
77    /* Read the data from the disk into provided memory buffer */
78    virtual void Read(void* buffer);
79
80    /**---------------Write the data------------------**/
81    virtual bool CanWriteFile(const char* FileNameToWrite);
82    /* Set the spacing and dimension information for the set file name */
83    virtual void WriteImageInformation();
84    /* Write the data to the disk from the provided memory buffer */
85    virtual void Write(const void* buffer);
86
87  protected:
88    BioFormatsImageIO();
89    ~BioFormatsImageIO();
90
91  private:
92    ChannelSeparator* reader;
93    ImageWriter* writer;
94  };
95
96}
97
98#endif // H_ITK_IMAGE_IO_H
Note: See TracBrowser for help on using the repository browser.