<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta name="robots" content="noindex"> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>ITK: itkImageFileReader.h Source File</title> <link href="DoxygenStyle.css" rel="stylesheet" type="text/css"> </head><body bgcolor="#ffffff"> <!-- Section customized for INSIGHT : Tue Jul 17 01:02:45 2001 --> <center> <a href="index.html" class="qindex">Main Page</a> <a href="modules.html" class="qindex">Groups</a> <a href="namespaces.html" class="qindex">Namespace List</a> <a href="hierarchy.html" class="qindex">Class Hierarchy</a> <a href="classes.html" class="qindex">Alphabetical List</a> <a href="annotated.html" class="qindex">Compound List</a> <a href="files.html" class="qindex">File List</a> <a href="namespacemembers.html" class="qindex">Namespace Members</a> <a href="functions.html" class="qindex">Compound Members</a> <a href="globals.html" class="qindex">File Members</a> <a href="pages.html" class="qindex">Concepts</a></center> <!-- Generated by Doxygen 1.5.9 --> <div class="navpath"><a class="el" href="dir_02e23d841c198393a6e961e9a0678fff.html">Code</a> » <a class="el" href="dir_1ee1ddeef2dd172ba0b5030f5ec71db5.html">IO</a> </div> <div class="contents"> <h1>itkImageFileReader.h</h1><a href="itkImageFileReader_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*=========================================================================</span> <a name="l00002"></a>00002 <span class="comment"></span> <a name="l00003"></a>00003 <span class="comment"> Program: Insight Segmentation & Registration Toolkit</span> <a name="l00004"></a>00004 <span class="comment"> Module: $RCSfile: itkImageFileReader.h,v $</span> <a name="l00005"></a>00005 <span class="comment"> Language: C++</span> <a name="l00006"></a>00006 <span class="comment"> Date: $Date: 2007-09-06 18:31:36 $</span> <a name="l00007"></a>00007 <span class="comment"> Version: $Revision: 1.31 $</span> <a name="l00008"></a>00008 <span class="comment"></span> <a name="l00009"></a>00009 <span class="comment"> Copyright (c) Insight Software Consortium. All rights reserved.</span> <a name="l00010"></a>00010 <span class="comment"> See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.</span> <a name="l00011"></a>00011 <span class="comment"></span> <a name="l00012"></a>00012 <span class="comment"> This software is distributed WITHOUT ANY WARRANTY; without even </span> <a name="l00013"></a>00013 <span class="comment"> the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR </span> <a name="l00014"></a>00014 <span class="comment"> PURPOSE. See the above copyright notices for more information.</span> <a name="l00015"></a>00015 <span class="comment"></span> <a name="l00016"></a>00016 <span class="comment">=========================================================================*/</span> <a name="l00017"></a>00017 <span class="preprocessor">#ifndef __itkImageFileReader_h</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define __itkImageFileReader_h</span> <a name="l00019"></a>00019 <span class="preprocessor"></span> <a name="l00020"></a>00020 <span class="preprocessor">#include "<a class="code" href="itkImageIOBase_8h.html">itkImageIOBase.h</a>"</span> <a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="itkImageSource_8h.html">itkImageSource.h</a>"</span> <a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="itkExceptionObject_8h.html">itkExceptionObject.h</a>"</span> <a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="itkSize_8h.html">itkSize.h</a>"</span> <a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="itkImageRegion_8h.html">itkImageRegion.h</a>"</span> <a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="itkDefaultConvertPixelTraits_8h.html">itkDefaultConvertPixelTraits.h</a>"</span> <a name="l00026"></a>00026 <a name="l00027"></a>00027 <span class="keyword">namespace </span>itk <a name="l00028"></a>00028 { <a name="l00029"></a>00029 <a name="l00034"></a><a class="code" href="classitk_1_1ImageFileReaderException.html">00034</a> <span class="keyword">class </span><a class="code" href="classitk_1_1ImageFileReaderException.html" title="Base exception class for IO conflicts.">ImageFileReaderException</a> : <span class="keyword">public</span> ExceptionObject <a name="l00035"></a>00035 { <a name="l00036"></a>00036 <span class="keyword">public</span>: <a name="l00038"></a>00038 <a class="code" href="itkMacro_8h.html#574c1f86661d409dd32c742307a0e96a">itkTypeMacro</a>( <a class="code" href="classitk_1_1ImageFileReaderException.html" title="Base exception class for IO conflicts.">ImageFileReaderException</a>, ExceptionObject ); <a name="l00039"></a>00039 <a name="l00041"></a><a class="code" href="classitk_1_1ImageFileReaderException.html#08f49fa108723d3178e7d643398dee9b">00041</a> <a class="code" href="classitk_1_1ImageFileReaderException.html#08f49fa108723d3178e7d643398dee9b">ImageFileReaderException</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *file, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> line, <a name="l00042"></a>00042 <span class="keyword">const</span> <span class="keywordtype">char</span>* message = <span class="stringliteral">"Error in IO"</span>, <a name="l00043"></a>00043 <span class="keyword">const</span> <span class="keywordtype">char</span>* loc = <span class="stringliteral">"Unknown"</span>) : <a name="l00044"></a>00044 ExceptionObject(file, line, message, loc) <a name="l00045"></a>00045 { <a name="l00046"></a>00046 } <a name="l00047"></a>00047 <a name="l00049"></a><a class="code" href="classitk_1_1ImageFileReaderException.html#6903918b083626afdf633a4ec1e09931">00049</a> <a class="code" href="classitk_1_1ImageFileReaderException.html#08f49fa108723d3178e7d643398dee9b">ImageFileReaderException</a>(<span class="keyword">const</span> std::string &file, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> line, <a name="l00050"></a>00050 <span class="keyword">const</span> <span class="keywordtype">char</span>* message = <span class="stringliteral">"Error in IO"</span>, <a name="l00051"></a>00051 <span class="keyword">const</span> <span class="keywordtype">char</span>* loc = <span class="stringliteral">"Unknown"</span>) : <a name="l00052"></a>00052 ExceptionObject(file, line, message, loc) <a name="l00053"></a>00053 { <a name="l00054"></a>00054 } <a name="l00055"></a>00055 }; <a name="l00057"></a>00057 <a name="l00058"></a>00058 <a name="l00091"></a>00091 <span class="keyword">template</span> <<span class="keyword">class </span>TOutputImage, <a name="l00092"></a>00092 <span class="keyword">class </span>ConvertPixelTraits=DefaultConvertPixelTraits< <a name="l00093"></a>00093 <a class="code" href="itkWin32Header_8h.html#140a5da12f0043ba181c7ae0109c31bf">ITK_TYPENAME</a> TOutputImage::IOPixelType > > <a name="l00094"></a><a class="code" href="classitk_1_1ImageFileReader.html">00094</a> <span class="keyword">class </span><a class="code" href="itkWin32Header_8h.html#7d4384322557205d75f0719c012dded6">ITK_EXPORT</a> <a class="code" href="classitk_1_1ImageFileReader.html" title="Data source that reads image data from a single file.">ImageFileReader</a> : <span class="keyword">public</span> <a class="code" href="classitk_1_1ImageSource.html" title="Base class for all process objects that output image data.">ImageSource</a><TOutputImage> <a name="l00095"></a>00095 { <a name="l00096"></a>00096 <span class="keyword">public</span>: <a name="l00098"></a><a class="code" href="classitk_1_1ImageFileReader.html#85a2ffab7ec1b2f48c8c1af613bb32cd">00098</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1ImageFileReader.html" title="Data source that reads image data from a single file.">ImageFileReader</a> <a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Self</a>; <a name="l00099"></a><a class="code" href="classitk_1_1ImageFileReader.html#fec7c8717aa613dec72a53098e748387">00099</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1ImageSource.html">ImageSource<TOutputImage></a> <a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Superclass</a>; <a name="l00100"></a><a class="code" href="classitk_1_1ImageFileReader.html#c0c93097f338106cfbd234affd4296db">00100</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1SmartPointer.html">SmartPointer<Self></a> <a class="code" href="classitk_1_1SmartPointer.html">Pointer</a>; <a name="l00101"></a>00101 <a name="l00103"></a>00103 <a class="code" href="itkMacro_8h.html#0fdc15685afa271857c57e7cd482f30c">itkNewMacro</a>(<a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Self</a>); <a name="l00104"></a>00104 <a name="l00106"></a><a class="code" href="classitk_1_1ImageFileReader.html#da01908855a741980daa2b23f0c83419">00106</a> <a class="code" href="itkMacro_8h.html#574c1f86661d409dd32c742307a0e96a">itkTypeMacro</a>(<a class="code" href="classitk_1_1ImageFileReader.html" title="Data source that reads image data from a single file.">ImageFileReader</a>, <a class="code" href="classitk_1_1ImageSource.html" title="Base class for all process objects that output image data.">ImageSource</a>); <a name="l00107"></a>00107 <a name="l00109"></a>00109 <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#5bf82236e1e50e653de84c8ead448599">TOutputImage::SizeType</a> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#5bf82236e1e50e653de84c8ead448599">SizeType</a>; <a name="l00110"></a>00110 <a name="l00112"></a><a class="code" href="classitk_1_1ImageFileReader.html#3c8cdf612f5072edec5239b2547bb54e">00112</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#be32dc19e71d40322ad9828b9ab40853">TOutputImage::IndexType</a> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#be32dc19e71d40322ad9828b9ab40853">IndexType</a>; <a name="l00113"></a>00113 <a name="l00115"></a><a class="code" href="classitk_1_1ImageFileReader.html#7e0f7748a755d48556c6a4a547dbdaad">00115</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ed8c4a40607d317c666eb96ea265e126">TOutputImage::RegionType</a> ImageRegionType; <a name="l00116"></a>00116 <a name="l00118"></a><a class="code" href="classitk_1_1ImageFileReader.html#e258041fb857f5b6c5063c9f2f187aef">00118</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> TOutputImage::InternalPixelType OutputImagePixelType; <a name="l00119"></a>00119 <a name="l00121"></a>00121 <a class="code" href="itkMacro_8h.html#3b9c68842cd296d3ef6d1ed0f5a742a4">itkSetStringMacro</a>(FileName); <a name="l00122"></a>00122 <a class="code" href="itkMacro_8h.html#bea8d1eeb8af8f01bfec0169f63f6871">itkGetStringMacro</a>(FileName); <a name="l00124"></a>00124 <a name="l00131"></a>00131 <span class="keywordtype">void</span> SetImageIO( <a class="code" href="classitk_1_1ImageIOBase.html" title="Abstract superclass defines image IO interface.">ImageIOBase</a> * imageIO ); <a name="l00132"></a>00132 <a class="code" href="itkMacro_8h.html#f6bef9ee7e4c077b96a08848ed4e7660">itkGetObjectMacro</a>(ImageIO,<a class="code" href="classitk_1_1ImageIOBase.html" title="Abstract superclass defines image IO interface.">ImageIOBase</a>); <a name="l00134"></a>00134 <a name="l00137"></a>00137 <span class="keyword">virtual</span> <span class="keywordtype">void</span> GenerateOutputInformation(<span class="keywordtype">void</span>); <a name="l00138"></a>00138 <a name="l00144"></a>00144 <span class="keyword">virtual</span> <span class="keywordtype">void</span> EnlargeOutputRequestedRegion(<a class="code" href="classitk_1_1DataObject.html" title="Base class for all data objects in ITK.">DataObject</a> *output); <a name="l00145"></a>00145 <a name="l00147"></a>00147 <a class="code" href="itkMacro_8h.html#7ebdd33cc5e7d74720ced9099c034faa">itkSetMacro</a>(UseStreaming,<span class="keywordtype">bool</span>); <a name="l00148"></a>00148 <a class="code" href="itkMacro_8h.html#7d989c13a1a213168db99ae0f84185d4">itkGetConstReferenceMacro</a>(UseStreaming,<span class="keywordtype">bool</span>); <a name="l00149"></a>00149 <a class="code" href="itkMacro_8h.html#9e7d129ffebb09fd28bc213e02d87248">itkBooleanMacro</a>(UseStreaming); <a name="l00151"></a>00151 <a name="l00152"></a>00152 <span class="keyword">protected</span>: <a name="l00153"></a>00153 <a class="code" href="classitk_1_1ImageFileReader.html" title="Data source that reads image data from a single file.">ImageFileReader</a>(); <a name="l00154"></a>00154 ~<a class="code" href="classitk_1_1ImageFileReader.html" title="Data source that reads image data from a single file.">ImageFileReader</a>(); <a name="l00155"></a>00155 <span class="keywordtype">void</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#920ae03048a5ad715d803ca2e92b52de">PrintSelf</a>(std::ostream& os, <a class="code" href="classitk_1_1Indent.html" title="Control indentation during Print() invocation.">Indent</a> indent) <span class="keyword">const</span>; <a name="l00156"></a>00156 <a name="l00158"></a>00158 <span class="keywordtype">void</span> DoConvertBuffer(<span class="keywordtype">void</span>* buffer, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> numberOfPixels); <a name="l00159"></a>00159 <a name="l00165"></a>00165 <span class="keywordtype">void</span> TestFileExistanceAndReadability(); <a name="l00166"></a>00166 <a name="l00168"></a>00168 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#f75a5945cdd8315676941024a0b8c1e9">GenerateData</a>(); <a name="l00169"></a>00169 <a name="l00170"></a><a class="code" href="classitk_1_1ImageFileReader.html#f1f13b816d9019dc1e13e52d6be15a12">00170</a> <a class="code" href="classitk_1_1SmartPointer.html">ImageIOBase::Pointer</a> m_ImageIO; <a name="l00171"></a><a class="code" href="classitk_1_1ImageFileReader.html#81f6c3a8b1695c0c58b26137260639f5">00171</a> <span class="keywordtype">bool</span> m_UserSpecifiedImageIO; <span class="comment">// keep track whether the</span> <a name="l00172"></a>00172 <span class="comment">// ImageIO is user specified </span> <a name="l00173"></a>00173 <a name="l00174"></a><a class="code" href="classitk_1_1ImageFileReader.html#f5a98bf0115b11571a2abcb7539a0b34">00174</a> std::string m_FileName; <span class="comment">// The file to be read</span> <a name="l00175"></a>00175 <a name="l00176"></a><a class="code" href="classitk_1_1ImageFileReader.html#1afd0f0090d9d47f0a738c1f0cacf667">00176</a> <span class="keywordtype">bool</span> m_UseStreaming; <a name="l00177"></a>00177 <a name="l00178"></a>00178 <span class="keyword">private</span>: <a name="l00179"></a>00179 <a class="code" href="classitk_1_1ImageFileReader.html" title="Data source that reads image data from a single file.">ImageFileReader</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Self</a>&); <span class="comment">//purposely not implemented</span> <a name="l00180"></a>00180 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Self</a>&); <span class="comment">//purposely not implemented</span> <a name="l00181"></a>00181 std::string m_ExceptionMessage; <a name="l00182"></a>00182 <a name="l00183"></a>00183 <span class="comment">// The region that the ImageIO class will return when we ask it to produce a</span> <a name="l00184"></a>00184 <span class="comment">// requested region.</span> <a name="l00185"></a>00185 ImageRegionType m_StreamableRegion; <a name="l00186"></a>00186 }; <a name="l00187"></a>00187 <a name="l00188"></a>00188 <a name="l00189"></a>00189 } <span class="comment">//namespace ITK</span> <a name="l00190"></a>00190 <a name="l00191"></a>00191 <span class="preprocessor">#ifndef ITK_MANUAL_INSTANTIATION</span> <a name="l00192"></a>00192 <span class="preprocessor"></span><span class="preprocessor">#include "itkImageFileReader.txx"</span> <a name="l00193"></a>00193 <span class="preprocessor">#endif</span> <a name="l00194"></a>00194 <span class="preprocessor"></span> <a name="l00195"></a>00195 <span class="preprocessor">#endif // __itkImageFileReader_h</span> <a name="l00196"></a>00196 <span class="preprocessor"></span> </pre></div></div> <hr><address><small> Generated at Thu May 7 23:01:39 2009 for ITK by <a href="http://www.stack.nl/~dimitri/doxygen/index.html"> <img src="http://www.stack.nl/~dimitri/doxygen/doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53> </a> 1.5.9 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>, © 1997-2000</small></address> </body> </html>