<div dir="ltr">Maybe I forgot to mention. I am trying to read given two volume images(.hdr and .img files) and multiply them. Then write the resultant image into one single image file(.hdr and .img)<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Apr 27, 2014 at 10:04 PM, Pansam Changmi <span dir="ltr"><<a href="mailto:pansam5green@gmail.com" target="_blank">pansam5green@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Error 27 error C2027: use of undefined type 'itk::Concept::MultiplyOperator' D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 98 1 MultiplyImageFilter<br>
Error 1 error C2039: 'PixelType' : is not a member of 'itk::ImageFileReader<TOutputImage>' D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 73 1 MultiplyImageFilter<br>
Error 4 error C2039: 'PixelType' : is not a member of 'itk::ImageFileReader<TOutputImage>' D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 74 1 MultiplyImageFilter<br>
Error 7 error C2039: 'PixelType' : is not a member of 'itk::ImageFileReader<TOutputImage>' D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 75 1 MultiplyImageFilter<br>
Error 13 error C2039: 'PixelType' : is not a member of 'itk::ImageFileReader<TOutputImage>' D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 82 1 MultiplyImageFilter<br>
Error 16 error C2039: 'PixelType' : is not a member of 'itk::ImageFileReader<TOutputImage>' D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 83 1 MultiplyImageFilter<br>
Error 19 error C2039: 'PixelType' : is not a member of 'itk::ImageFileReader<TOutputImage>' D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 84 1 MultiplyImageFilter<br>
Error 24 error C2039: 'PixelType' : is not a member of 'itk::ImageFileReader<TOutputImage>' D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 98 1 MultiplyImageFilter<br>
Error 3 error C2065: 'PixelType' : undeclared identifier D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 73 1 MultiplyImageFilter<br>Error 6 error C2065: 'PixelType' : undeclared identifier D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 74 1 MultiplyImageFilter<br>
Error 9 error C2065: 'PixelType' : undeclared identifier D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 75 1 MultiplyImageFilter<br>Error 15 error C2065: 'PixelType' : undeclared identifier D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 82 1 MultiplyImageFilter<br>
Error 18 error C2065: 'PixelType' : undeclared identifier D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 83 1 MultiplyImageFilter<br>Error 21 error C2065: 'PixelType' : undeclared identifier D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 84 1 MultiplyImageFilter<br>
Error 26 error C2065: 'PixelType' : undeclared identifier D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 98 1 MultiplyImageFilter<br>Error 2 error C2146: syntax error : missing ',' before identifier 'PixelType' D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 73 1 MultiplyImageFilter<br>
Error 5 error C2146: syntax error : missing ',' before identifier 'PixelType' D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 74 1 MultiplyImageFilter<br>Error 8 error C2146: syntax error : missing ',' before identifier 'PixelType' D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 75 1 MultiplyImageFilter<br>
Error 14 error C2146: syntax error : missing ',' before identifier 'PixelType' D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 82 1 MultiplyImageFilter<br>Error 17 error C2146: syntax error : missing ',' before identifier 'PixelType' D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 83 1 MultiplyImageFilter<br>
Error 20 error C2146: syntax error : missing ',' before identifier 'PixelType' D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 84 1 MultiplyImageFilter<br>Error 25 error C2146: syntax error : missing ',' before identifier 'PixelType' D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 98 1 MultiplyImageFilter<br>
Error 28 error C2663: 'itk::BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,TFunction>::SetInput1' : 3 overloads have no legal conversion for 'this' pointer D:\Academics\Course\Semester 12\Design of Surgical Devices\Project\TestProject\MultiplyImageFilter\src\MultiplyImageFilter.cxx 37 1 MultiplyImageFilter<br>
Error 29 error C2663: 'itk::BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,TFunction>::SetInput2' : 3 overloads have no legal conversion for 'this' pointer D:\Academics\Course\Semester 12\Design of Surgical Devices\Project\TestProject\MultiplyImageFilter\src\MultiplyImageFilter.cxx 38 1 MultiplyImageFilter<br>
Error 12 error C2955: 'itk::BinaryFunctorImageFilter' : use of class template requires template argument list D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 76 1 MultiplyImageFilter<br>
Error 11 error C2955: 'itk::Functor::Mult' : use of class template requires template argument list D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 75 1 MultiplyImageFilter<br>
Error 23 error C2955: 'itk::Functor::Mult' : use of class template requires template argument list D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 85 1 MultiplyImageFilter<br>
Error 10 error C3203: 'Mult' : unspecialized class template can't be used as a template argument for template parameter 'TFunction', expected a real type D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 75 1 MultiplyImageFilter<br>
Error 22 error C3203: 'Mult' : unspecialized class template can't be used as a template argument for template parameter 'TFunction', expected a real type D:\ITK\src\Modules\Filtering\ImageIntensity\include\itkMultiplyImageFilter.h 85 1 MultiplyImageFilter<br>
30 IntelliSense: no instance of overloaded function "itk::ImageFileWriter<TInputImage>::SetInput [with TInputImage=itk::Image<unsigned char, 3U>]" matches the argument list<br> argument types are: (itk::ImageFileReader<itk::Image<unsigned char, 3U>, itk::DefaultConvertPixelTraits<unsigned char>> *)<br>
object type is: itk::ImageFileWriter<itk::Image<unsigned char, 3U>> d:\Academics\Course\Semester 12\Design of Surgical Devices\Project\TestProject\MultiplyImageFilter\src\MultiplyImageFilter.cxx 43 9 MultiplyImageFilter<br>
<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Apr 27, 2014 at 8:29 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What are the errors?<br>
<div><div><br>
On Sun, Apr 27, 2014 at 10:48 AM, Pansam Changmi <<a href="mailto:pansam5green@gmail.com" target="_blank">pansam5green@gmail.com</a>> wrote:<br>
> Thanks guys. My requirement is kind of just using ITK. It is an assignment<br>
> actually.<br>
> Can you guys help me out what am I doing wrong here. I have busted my head<br>
> over this for the whole day. I am getting like 30 errors :'(<br>
><br>
> The code:<br>
><br>
><br>
> #include "itkImage.h"<br>
> #include "itkImageFileReader.h"<br>
> #include "itkImageFileWriter.h"<br>
> #include "itkRescaleIntensityImageFilter.h"<br>
> #include "itkMultiplyImageFilter.h"<br>
><br>
> int main( int argc, char * argv[] )<br>
> {<br>
> if( argc < 4 )<br>
> {<br>
> std::cerr << "Usage: " << argv[0];<br>
> std::cerr << " image1 image2 ";<br>
><br>
> std::cerr << "outputImagefile " << std::endl;<br>
> return EXIT_FAILURE;<br>
> }<br>
><br>
> typedef unsigned char PixelType;<br>
><br>
> const unsigned int Dimension = 3;<br>
> typedef itk::Image< PixelType, Dimension > Image1Type;<br>
> typedef itk::Image< PixelType, Dimension > Image2Type;<br>
><br>
> typedef itk::ImageFileReader< Image1Type > Image1ReaderType;<br>
> typedef itk::ImageFileReader< Image2Type > Image2ReaderType;<br>
><br>
><br>
> Image1ReaderType::Pointer Image1Reader = Image1ReaderType::New();<br>
> Image2ReaderType::Pointer Image2Reader = Image2ReaderType::New();<br>
><br>
> Image1Reader->SetFileName( argv[1] );<br>
> Image2Reader->SetFileName( argv[2] );<br>
><br>
> typedef itk::MultiplyImageFilter <Image1ReaderType, Image2ReaderType ><br>
> MultiplyImageFilterType;<br>
><br>
> MultiplyImageFilterType::Pointer multiplyFilter =<br>
> MultiplyImageFilterType::New ();<br>
> multiplyFilter->SetInput1(Image1Reader);<br>
> multiplyFilter->SetInput2(Image2Reader);<br>
><br>
> typedef itk::Image< PixelType, Dimension > OutputImageType;<br>
> typedef itk::ImageFileWriter< OutputImageType > WriterType;<br>
> WriterType::Pointer writer = WriterType::New();<br>
> writer->SetFileName( argv[3] );<br>
> writer->SetInput( multiplyFilter->GetOutput() );<br>
> writer->Update();<br>
><br>
> return EXIT_SUCCESS;<br>
> }<br>
><br>
><br>
><br>
><br>
> On Sun, Apr 27, 2014 at 7:00 PM, Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>><br>
> wrote:<br>
>><br>
>> Hello,<br>
>><br>
>> You may be interested in the SimpleITK bindings for ITK. SimpleITK<br>
>> provides an easy to use interface on top of ITK which excels facilitation<br>
>> quick image manipulation with ITK, and enables interactive manipulations<br>
>> with tools such as IPython[1]<br>
>><br>
>> SimpleITK for python is readily available as a binary download[2]. What<br>
>> you are looking for can be done in SimpleITK like this:<br>
>><br>
>> import SimpleITK as sitk<br>
>> img1 = sitk.ReadImage("head.img")<br>
>> img2 = sitk.ReadImage("BrainMask.img")<br>
>> out = img1*img2<br>
>> sitk.WriteImage("out.img")<br>
>><br>
>> This assumes that the two images occupy the same physical space and are<br>
>> the same pixel type. The binary operators in SimpleITK require that the<br>
>> pixel types are the same, so a cast may be needed.<br>
>><br>
>> However, if you are multiplying a mask by the grayscale you may be<br>
>> interested in the MaskImageFilter[3]. This filter will support most<br>
>> combinations and can be used:<br>
>><br>
>> sitk.Mask(img1, img2).<br>
>><br>
>> Enjoy,<br>
>> Brad<br>
>><br>
>> [1] <a href="http://simpleitk.github.io/SimpleITK-Notebooks/" target="_blank">http://simpleitk.github.io/SimpleITK-Notebooks/</a><br>
>> [2]<br>
>> <a href="http://www.itk.org/Wiki/SimpleITK/GettingStarted#Downloading_the_binaries" target="_blank">http://www.itk.org/Wiki/SimpleITK/GettingStarted#Downloading_the_binaries</a><br>
>> [3]<br>
>> <a href="http://www.itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1MaskImageFilter.html" target="_blank">http://www.itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1MaskImageFilter.html</a><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> On Apr 27, 2014, at 1:39 AM, Pansam Changmi <<a href="mailto:pansam5green@gmail.com" target="_blank">pansam5green@gmail.com</a>><br>
>> wrote:<br>
>><br>
>> > Hi,<br>
>> ><br>
>> > Can anyone tell me how to multiply two .img or .hdr images (for example<br>
>> > head.img and BrainMask.img) in ITK? Do I need VTK? ITK-Snap? C3d tool?<br>
>> ><br>
>> > Regards,<br>
>> > Pansam<br>
>> > _____________________________________<br>
>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> ><br>
>> > Visit other Kitware open-source projects at<br>
>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> ><br>
>> > Kitware offers ITK Training Courses, for more information visit:<br>
>> > <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
>> ><br>
>> > Please keep messages on-topic and check the ITK FAQ at:<br>
>> > <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
>> ><br>
>> > Follow this link to subscribe/unsubscribe:<br>
>> > <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
>><br>
><br>
><br>
> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
<br>
<br>
<br>
</div></div><span><font color="#888888">--<br>
Unpaid intern in BillsBasement at noware dot com<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>