ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
00001 /*========================================================================= 00002 * 00003 * Copyright Insight Software Consortium 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0.txt 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 * 00017 *=========================================================================*/ 00018 /*========================================================================= 00019 * 00020 * Portions of this file are subject to the VTK Toolkit Version 3 copyright. 00021 * 00022 * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00023 * 00024 * For complete copyright, license and disclaimer of warranty information 00025 * please refer to the NOTICE file at the top of the ITK source tree. 00026 * 00027 *=========================================================================*/ 00028 #ifndef __itkStimulateImageIO_h 00029 #define __itkStimulateImageIO_h 00030 00031 00032 #include <fstream> 00033 #include "itkImageIOBase.h" 00034 00035 namespace itk 00036 { 00061 class ITK_EXPORT StimulateImageIO:public ImageIOBase 00062 { 00063 public: 00065 typedef StimulateImageIO Self; 00066 typedef ImageIOBase Superclass; 00067 typedef SmartPointer< Self > Pointer; 00068 00070 itkNewMacro(Self); 00071 00073 itkTypeMacro(StimulateImageIO, Superclass); 00074 00075 /*-------- This part of the interface deals with reading data. ------ */ 00076 00079 virtual bool CanReadFile(const char *); 00080 00082 virtual void ReadImageInformation(); 00083 00085 virtual void Read(void *buffer); 00086 00087 /*-------- This part of the interfaces deals with writing data. ----- */ 00088 00091 virtual bool CanWriteFile(const char *); 00092 00095 virtual void WriteImageInformation() {} 00096 00099 virtual void Write(const void *buffer); 00100 00107 itkGetVectorMacro(DisplayRange, const float, 2); 00108 const float & GetHighDisplayValue() 00109 { 00110 return m_DisplayRange[1]; 00111 } 00112 const float & GetLowDisplayValue() 00113 { 00114 return m_DisplayRange[1]; 00115 } 00117 00118 protected: 00119 StimulateImageIO(); 00120 ~StimulateImageIO(); 00121 void PrintSelf(std::ostream & os, Indent indent) const; 00122 00123 bool OpenStimulateFileForReading(std::ifstream & os, const char *filename); 00124 00125 bool OpenStimulateFileForWriting(std::ofstream & os, const char *filename); 00126 00127 void InternalReadImageInformation(std::ifstream & file); 00128 00129 private: 00130 std::string m_DataFileName; 00131 char m_SdtOrient[256]; 00132 float m_DisplayRange[2]; 00133 float m_DisplayThresh; 00134 char m_FidName[256]; 00135 00136 StimulateImageIO(const Self &); //purposely not implemented 00137 void operator=(const Self &); //purposely not implemented 00138 }; 00139 } // end namespace itk 00140 00141 #endif // __itkStimulateImageIO_h 00142