<div>XueQuan,</div>
<div> </div>
<div>The AndImageFilter (and other logical filters) require types that are of integral type. From the comments in itkAndImageFilter.h:</div>
<div> *<br> * Since the logical AND operation is only defined in C++ for integer<br> * types, the images passed to this filter must comply with the requirement<br> * of using integer pixel type. <br> </div>
<div>Unfortunately, the error message is a bit cryptic. If you turn ITK_USE_CONCEPT_CHECKING ON (it is an advanced cmake option), you will see a better error message.</div>
<div> </div>
<div>So, you should cast your input to an integral type before doing the and.</div>
<div> </div>
<div>Bill</div>
<div><br><br> </div>
<div><span class="gmail_quote">On 3/12/07, <b class="gmail_sendername"><a href="mailto:qxue@jouy.inra.fr">qxue@jouy.inra.fr</a></b> <<a href="mailto:qxue@jouy.inra.fr">qxue@jouy.inra.fr</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hello, everyone:<br><br> I am using the "ItkAndImageFilter" in VC6.0 in Windows XP by CMake2.4. When I
<br>add the ITKAndImageFilter to my program, there are errors as following:<br><br>C:\DOCUME~1\qxue\MESDOC~1\ITK\INSIGH~1.0\Code\BASICF~1\itkAndImageFilter.h(64) :<br>error C2296: '&' : illegal, left operand has type 'const float'
<br><br>C:\DOCUME~1\qxue\MESDOC~1\ITK\INSIGH~1.0\Code\BASICF~1\itkAndImageFilter.h(63)<br>: while compiling class-template member function 'float __thiscall<br>itk::Functor::AND<float,float,float>::operator ()(const float &,const float &)'
<br>C:\DOCUME~1\qxue\MESDOC~1\ITK\INSIGH~1.0\Code\BASICF~1\itkAndImageFilter.h(64) :<br>error C2297: '&' : illegal, right operand has type 'const float'<br><br>C:\DOCUME~1\qxue\MESDOC~1\ITK\INSIGH~1.0\Code\BASICF~1\itkAndImageFilter.h(63)
<br>: while compiling class-template member function 'float __thiscall<br>itk::Functor::AND<float,float,float>::operator ()(const float &,const float &)'<br>CellularSegmentationApplication.cxx<br>C:\DOCUME~1\qxue\MESDOC~1\ITK\INSIGH~1.0\Code\BASICF~1\itkAndImageFilter.h(64) :
<br>error C2296: '&' : illegal, left operand has type 'const float'<br><br>C:\DOCUME~1\qxue\MESDOC~1\ITK\INSIGH~1.0\Code\BASICF~1\itkAndImageFilter.h(63)<br>: while compiling class-template member function 'float __thiscall
<br>itk::Functor::AND<float,float,float>::operator ()(const float &,const float &)'<br>C:\DOCUME~1\qxue\MESDOC~1\ITK\INSIGH~1.0\Code\BASICF~1\itkAndImageFilter.h(64) :<br>error C2297: '&' : illegal, right operand has type 'const float'
<br><br>C:\DOCUME~1\qxue\MESDOC~1\ITK\INSIGH~1.0\Code\BASICF~1\itkAndImageFilter.h(63)<br>: while compiling class-template member function 'float __thiscall<br>itk::Functor::AND<float,float,float>::operator ()(const float &,const float &)'
<br><br> I have used other filters from ITK and there are fine.<br><br> Who can give me a help to resolve it?<br><br> Best regards,<br>XueQuan<br>_______________________________________________<br>Insight-users mailing list
<br><a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br></blockquote></div><br>