-#ifndef NKITKXDRIMAGEIO_H
-#define NKITKXDRIMAGEIO_H
+#ifndef CLITKXDRIMAGEIO_H
+#define CLITKXDRIMAGEIO_H
/**
- * @file nkitkXDRImageIO.h
+ * @file clitkXdrImageIO.h
* @author Simon Rit <simon.rit@gmail.com>
* @date Sun Jun 1 22:07:45 2008
*
// itk include
#include "itkImageIOBase.h"
-namespace nkitk {
+#define AVSerror(v) itkGenericExceptionMacro(<< "Error in clitk::XdrImageIO. Message:" << v);
+#define AVSwarning(v) itkWarningMacro(<< "Error in clitk::XdrImageIO. Message:" << v);
+
+namespace clitk {
//====================================================================
-// Class for reading XDR Image file format
-class XDRImageIO: public itk::ImageIOBase
+// Class for reading xdr Image file format
+class XdrImageIO: public itk::ImageIOBase
{
public:
/** Standard class typedefs. */
- typedef XDRImageIO Self;
+ typedef XdrImageIO Self;
typedef itk::ImageIOBase Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef signed short int PixelType;
typedef enum {UNIFORM,RECTILINEAR,IRREGULAR} AVSType;
- XDRImageIO():Superclass() {
+ XdrImageIO():Superclass() {
forcenoswap = 0;
}
itkNewMacro(Self);
/** Run-time type information (and related methods). */
- itkTypeMacro(XDRImageIO, ImageIOBase);
+ itkTypeMacro(XdrImageIO, ImageIOBase);
/*-------- This part of the interface deals with reading data. ------ */
virtual int ReadImageInformationWithError();
virtual bool CanReadFile( const char* FileNameToRead );
/*-------- This part of the interfaces deals with writing data. ----- */
- virtual void WriteImageInformation(bool keepOfStream) {
- ;
- }
- virtual void WriteImageInformation() {
- WriteImageInformation(false);
- }
- virtual bool CanWriteFile(const char* filename) {
- return false;
- }
- virtual void Write(const void* buffer) {
- ;
- }
+ virtual void WriteImageInformation(bool keepOfStream) {;}
+ virtual void WriteImageInformation() { WriteImageInformation(false); }
+ virtual bool CanWriteFile(const char* FileNameToWrite);
+ virtual void Write(const void* buffer);
protected:
void ITKError(std::string funcName, int msgID);
+ void WriteImage(const char* file, char* headerinfo, char* headerfile, int raw,\r
+ int offset, char bLittleEndian, int iNkiCompression,\r
+ int wcoords, int append, int getsize, char *tobuffer, const void* data);\r
int m_HeaderSize;
int forcenoswap;
-}; // end class XDRImageIO
+}; // end class XdrImageIO
} // end namespace
// explicit template instantiation
-template class itk::CreateObjectFunction<nkitk::XDRImageIO>;
+template class itk::CreateObjectFunction<clitk::XdrImageIO>;
-#endif /* end #define NKITKXDRIMAGEIO_H */
+#endif /* end #define CLITKXDRIMAGEIO_H */