ok I am now trying to follow the example from the ItkSoftwareGuide.pdf page 330. I have made a new project using ITK 3.12.0 (just copied the HelloWorld example) and in the source file I have:<br><br>#include &quot;itkImage.h&quot;<br>
#include &lt;iostream&gt;<br>#include &quot;itkGDCMImageIO.h&quot;<br>#include &quot;itkGDCMSeriesFileNames.h&quot;<br>#include &quot;itkImageSeriesReader.h&quot;<br>#include &quot;itkImageFileWriter.h&quot;<br><br>int main( int argc, char* argv[] )<br>
{<br><br>    if( argc &lt; 3 ){<br>        std::cerr &lt;&lt; &quot;Usage: &quot; &lt;&lt; std::endl;<br>        std::cerr &lt;&lt; argv[0] &lt;&lt; &quot; DicomDirectory  outputFileName  [seriesName]&quot; <br>            &lt;&lt; std::endl;<br>
        return EXIT_FAILURE;<br>    }<br><br>  const unsigned int Dimension = 3;    <br>    typedef signed short                                                    PixelType;<br>    typedef itk::Image&lt; PixelType, Dimension &gt;        ImageType;<br>
    typedef itk::ImageSeriesReader&lt; ImageType &gt;        ReaderType;<br><br>    ReaderType::Pointer bob = ReaderType::New();  // This line gives a linker error.<br>...<br>...<br><br><br>But the last line:<br><br><br>
    ReaderType::Pointer bob = ReaderType::New();<br><br><br>gives the following linker errors when compiling using Visual Studio 2008 on Vista 64:<br><br>&gt;HelloWorld.obj : error LNK2019: unresolved external symbol &quot;public: static class itk::SmartPointer&lt;class itk::ImageIOBase&gt; __cdecl itk::ImageIOFactory::CreateImageIO(char const *,enum itk::ImageIOFactory::FileModeType)&quot; (?CreateImageIO@ImageIOFactory@itk@@SA?AV?$SmartPointer@VImageIOBase@itk@@@2@PBDW4FileModeType@12@@Z) referenced in function __catch$?GenerateOutputInformation@?$ImageFileReader@V?$Image@F$02@itk@@V?$DefaultConvertPixelTraits@F@2@@itk@@UAEXXZ$0<br>
1&gt;HelloWorld.obj : error LNK2019: unresolved external symbol &quot;public: virtual __thiscall itk::ImageIORegion::~ImageIORegion(void)&quot; (??1ImageIORegion@itk@@UAE@XZ) referenced in function &quot;public: virtual void __thiscall itk::ImageFileReader&lt;class itk::Image&lt;short,3&gt;,class itk::DefaultConvertPixelTraits&lt;short&gt; &gt;::EnlargeOutputRequestedRegion(class itk::DataObject *)&quot; (?EnlargeOutputRequestedRegion@?$ImageFileReader@V?$Image@F$02@itk@@V?$DefaultConvertPixelTraits@F@2@@itk@@UAEXPAVDataObject@2@@Z)<br>
1&gt;HelloWorld.obj : error LNK2019: unresolved external symbol &quot;public: __thiscall itk::ImageIORegion::ImageIORegion(unsigned int)&quot; (??0ImageIORegion@itk@@QAE@I@Z) referenced in function &quot;public: virtual void __thiscall itk::ImageFileReader&lt;class itk::Image&lt;short,3&gt;,class itk::DefaultConvertPixelTraits&lt;short&gt; &gt;::EnlargeOutputRequestedRegion(class itk::DataObject *)&quot; (?EnlargeOutputRequestedRegion@?$ImageFileReader@V?$Image@F$02@itk@@V?$DefaultConvertPixelTraits@F@2@@itk@@UAEXPAVDataObject@2@@Z)<br>
1&gt;HelloWorld.obj : error LNK2019: unresolved external symbol &quot;public: long __thiscall itk::ImageIOBase::GetImageSizeInBytes(void)const &quot; (?GetImageSizeInBytes@ImageIOBase@itk@@QBEJXZ) referenced in function __catch$?GenerateData@?$ImageFileReader@V?$Image@F$02@itk@@V?$DefaultConvertPixelTraits@F@2@@itk@@MAEXXZ$0<br>
1&gt;HelloWorld.obj : error LNK2019: unresolved external symbol &quot;public: __thiscall itk::ImageIORegion::ImageIORegion(class itk::ImageIORegion const &amp;)&quot; (??0ImageIORegion@itk@@QAE@ABV01@@Z) referenced in function __catch$?GenerateData@?$ImageFileReader@V?$Image@F$02@itk@@V?$DefaultConvertPixelTraits@F@2@@itk@@MAEXXZ$0<br>
1&gt;HelloWorld.obj : error LNK2019: unresolved external symbol &quot;class std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp; __cdecl itk::operator&lt;&lt;(class std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,class itk::ImageIORegion const &amp;)&quot; (??6itk@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV12@ABVImageIORegion@0@@Z) referenced in function __catch$?GenerateData@?$ImageFileReader@V?$Image@F$02@itk@@V?$DefaultConvertPixelTraits@F@2@@itk@@MAEXXZ$0<br>
1&gt;HelloWorld.obj : error LNK2019: unresolved external symbol &quot;public: void __thiscall itk::ImageIORegion::SetIndex(unsigned long,long)&quot; (?SetIndex@ImageIORegion@itk@@QAEXKJ@Z) referenced in function &quot;public: static void __cdecl itk::ImageIORegionAdaptor&lt;3&gt;::Convert(class itk::ImageRegion&lt;3&gt; const &amp;,class itk::ImageIORegion &amp;,class itk::Index&lt;3&gt; const &amp;)&quot; (?Convert@?$ImageIORegionAdaptor@$02@itk@@SAXABV?$ImageRegion@$02@2@AAVImageIORegion@2@ABV?$Index@$02@2@@Z)<br>
1&gt;HelloWorld.obj : error LNK2019: unresolved external symbol &quot;public: void __thiscall itk::ImageIORegion::SetSize(unsigned long,unsigned long)&quot; (?SetSize@ImageIORegion@itk@@QAEXKK@Z) referenced in function &quot;public: static void __cdecl itk::ImageIORegionAdaptor&lt;3&gt;::Convert(class itk::ImageRegion&lt;3&gt; const &amp;,class itk::ImageIORegion &amp;,class itk::Index&lt;3&gt; const &amp;)&quot; (?Convert@?$ImageIORegionAdaptor@$02@itk@@SAXABV?$ImageRegion@$02@2@AAVImageIORegion@2@ABV?$Index@$02@2@@Z)<br>
1&gt;HelloWorld.obj : error LNK2019: unresolved external symbol &quot;public: unsigned int __thiscall itk::ImageIORegion::GetImageDimension(void)const &quot; (?GetImageDimension@ImageIORegion@itk@@QBEIXZ) referenced in function &quot;public: static void __cdecl itk::ImageIORegionAdaptor&lt;3&gt;::Convert(class itk::ImageRegion&lt;3&gt; const &amp;,class itk::ImageIORegion &amp;,class itk::Index&lt;3&gt; const &amp;)&quot; (?Convert@?$ImageIORegionAdaptor@$02@itk@@SAXABV?$ImageRegion@$02@2@AAVImageIORegion@2@ABV?$Index@$02@2@@Z)<br>
1&gt;HelloWorld.obj : error LNK2019: unresolved external symbol &quot;public: long __thiscall itk::ImageIORegion::GetIndex(unsigned long)const &quot; (?GetIndex@ImageIORegion@itk@@QBEJK@Z) referenced in function &quot;public: static void __cdecl itk::ImageIORegionAdaptor&lt;3&gt;::Convert(class itk::ImageIORegion const &amp;,class itk::ImageRegion&lt;3&gt; &amp;,class itk::Index&lt;3&gt; const &amp;)&quot; (?Convert@?$ImageIORegionAdaptor@$02@itk@@SAXABVImageIORegion@2@AAV?$ImageRegion@$02@2@ABV?$Index@$02@2@@Z)<br>
1&gt;HelloWorld.obj : error LNK2019: unresolved external symbol &quot;public: unsigned long __thiscall itk::ImageIORegion::GetSize(unsigned long)const &quot; (?GetSize@ImageIORegion@itk@@QBEKK@Z) referenced in function &quot;public: static void __cdecl itk::ImageIORegionAdaptor&lt;3&gt;::Convert(class itk::ImageIORegion const &amp;,class itk::ImageRegion&lt;3&gt; &amp;,class itk::Index&lt;3&gt; const &amp;)&quot; (?Convert@?$ImageIORegionAdaptor@$02@itk@@SAXABVImageIORegion@2@AAV?$ImageRegion@$02@2@ABV?$Index@$02@2@@Z)<br>
1&gt;HelloWorld.obj : error LNK2019: unresolved external symbol &quot;public: class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; __thiscall itk::ImageIOBase::GetComponentTypeAsString(enum itk::ImageIOBase::IOComponentType)const &quot; (?GetComponentTypeAsString@ImageIOBase@itk@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4IOComponentType@12@@Z) referenced in function &quot;protected: void __thiscall itk::ImageFileReader&lt;class itk::Image&lt;short,3&gt;,class itk::DefaultConvertPixelTraits&lt;short&gt; &gt;::DoConvertBuffer(void *,unsigned long)&quot; (?DoConvertBuffer@?$ImageFileReader@V?$Image@F$02@itk@@V?$DefaultConvertPixelTraits@F@2@@itk@@IAEXPAXK@Z)<br>
<br><br><br>This is the content of the CMakeLists.txt file:<br><br># This is the root ITK CMakeLists file.<br>CMAKE_MINIMUM_REQUIRED(VERSION 2.4)<br>IF(COMMAND CMAKE_POLICY)<br>  CMAKE_POLICY(SET CMP0003 NEW)<br>ENDIF(COMMAND CMAKE_POLICY)<br>
<br><br># This project is designed to be built outside the Insight source tree.<br>PROJECT(HelloWorld)<br><br># Find ITK.<br>FIND_PACKAGE(ITK REQUIRED)<br>INCLUDE(${ITK_USE_FILE})<br><br>ADD_EXECUTABLE(HelloWorld HelloWorld.cxx )<br>
<br>TARGET_LINK_LIBRARIES(HelloWorld ITKCommon)<br><br><br>Do I need to add some LINK_DIRECTORIES ?<br><br><br><div class="gmail_quote">On Wed, Jun 10, 2009 at 11:26 AM, Mathieu Malaterre <span dir="ltr">&lt;<a href="mailto:mathieu.malaterre@gmail.com">mathieu.malaterre@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">On Tue, Jun 9, 2009 at 10:56 PM, motes motes&lt;<a href="mailto:mort.motes@gmail.com">mort.motes@gmail.com</a>&gt; wrote:<br>

&gt; I have a .dcm file containing multiple frames. I need to downsample each<br>
&gt; frame and store them in a new and smaller .dcm file. Currently I use matlab<br>
&gt; for the first part:<br>
&gt;<br>
&gt; for i=1: frameNum<br>
&gt;   img0 = dicomread(filename, &#39;frames&#39;, i)<br>
&gt;   img1 =  downsample(img0);<br>
&gt;   %dicomwrite(img1, &#39;test.dcm&#39;)<br>
&gt;   % store img1....<br>
&gt; end<br>
&gt;<br>
&gt; But it seems that its only possible to store each frame as a separate file -<br>
&gt; and not as a single multiframe .dcm file.<br>
&gt;<br>
&gt; I was therefore wondering if ITK had any functionality to make this<br>
&gt; possible? I found this post:<br>
&gt;<br>
&gt; <a href="http://www.itk.org/pipermail/insight-users/2003-September/004762.html" target="_blank">http://www.itk.org/pipermail/insight-users/2003-September/004762.html</a><br>
&gt;<br>
&gt; and the file itkDICOMImageSeriesTest.cxx in:<br>
&gt;<br>
&gt; InsightToolkit-3.12.0\Testing\Code\IO<br>
&gt;<br>
&gt; But maybe there are some more documentation on how to do this?<br>
&gt;<br>
<br>
</div></div>Yes.<br>
7.12.3 Reading a 2D DICOM Series and Writing a Volume (from<br>
ItkSoftwareGuide.pdf).<br>
<br>
Please do not cross post to dicom newsgroup for a matlab function, thanks.<br>
<br>
2cts.<br>
--<br>
<font color="#888888">Mathieu<br>
</font></blockquote></div><br>