[Insight-users] itkRaycastInterpolateImageFunction problem

Jared Starman jstarman at stanford.edu
Thu, 29 Apr 2004 12:17:19 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_0009_01C42DE3.EB1D2B40
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi,
I'm new to using ITK, and I'm trying to execute the following code.
 
typedef double               VoxelType;
            const   unsigned int        VolumeDimension = 3;
 
            typedef itk::Image< VoxelType, VolumeDimension >
ImageTypeVolume;
            
typedef itk::RayCastInterpolateImageFunction< ImageTypeVolume, double >
RayCastType;
RayCastType::Pointer RayCaster = RayCastType::New();
 
However, I get the following error from MVC++ 6.0 that says
.itkRayCastInterpolateImageFunction.txx(595) : error C2440:
'initializing' : cannot convert from 'const class itk::Vector<double,3>'
to 'const double *
'
        No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called
 
.\..\..\Insight\InsightToolkit-1.6.0\Code\Common\itkImportImageContainer
.h(87) : while compiling class-template member function 'bool __thiscall
itk::RayCastInterpolateImageFunction<class
itk::Image<double,3>,double>::SetRay(class itk::Point
<double,3>,class itk::Vector<double,3>) const'
 
So, what exactly am I doing wrong?
 
Thanks for your help!
-Jared
 
 

------=_NextPart_000_0009_01C42DE3.EB1D2B40
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">


<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 10">
<meta name=3DOriginator content=3D"Microsoft Word 10">
<link rel=3DFile-List href=3D"cid:filelist.xml at 01C42DE3.EAEAA990">
<!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:DoNotRelyOnCSS/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:DocumentKind>DocumentEmail</w:DocumentKind>
  <w:EnvelopeVis/>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:ApplyBreakingRules/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
span.EmailStyle17
	{mso-style-type:personal-compose;
	mso-style-noshow:yes;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:Arial;
	mso-ascii-font-family:Arial;
	mso-hansi-font-family:Arial;
	mso-bidi-font-family:Arial;
	color:windowtext;}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
span.GramE
	{mso-style-name:"";
	mso-gram-e:yes;}
 at page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */=20
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
</style>
<![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple =
style=3D'tab-interval:.5in'>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hi,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I&#8217;m new to using ITK, and I&#8217;m trying to =
execute
the following code.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-indent:.5in'><span =
class=3DSpellE><span
class=3DGramE><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:
Arial'>typedef</span></font></span></span><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> double<span =
style=3D'mso-tab-count:
1'>&nbsp;&nbsp; </span><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; </span><span
class=3DSpellE>VoxelType</span>;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; </span><span
class=3DGramE>const</span><span style=3D'mso-spacerun:yes'>&nbsp;&nbsp;
</span>unsigned <span class=3DSpellE>int</span><span
style=3D'mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
</span><span
class=3DSpellE>VolumeDimension</span> =3D =
3;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; </span><span
class=3DSpellE><span class=3DGramE>typedef</span></span> <span =
class=3DSpellE>itk::Image</span>&lt;
<span class=3DSpellE>VoxelType</span>, <span =
class=3DSpellE>VolumeDimension</span>
&gt;<span style=3D'mso-spacerun:yes'>&nbsp;&nbsp;&nbsp; </span><span
class=3DSpellE>ImageTypeVolume</span>;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><span =
style=3D'mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-indent:.5in'><span =
class=3DSpellE><span
class=3DGramE><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:
Arial'>typedef</span></font></span></span><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> <span =
class=3DSpellE>itk::RayCastInterpolateImageFunction</span>&lt;
<span class=3DSpellE>ImageTypeVolume</span>, double &gt;<span
style=3D'mso-spacerun:yes'>&nbsp; </span><span =
class=3DSpellE>RayCastType</span>;<o:p></o:p></span></font></p>

<p class=3DMsoNormal style=3D'text-indent:.5in'><span =
class=3DSpellE><font size=3D2
face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>RayCastType::Pointer</span><=
/font></span><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> <span
class=3DSpellE>RayCaster</span> =3D <span =
class=3DSpellE>RayCastType::<span
class=3DGramE>New</span></span><span =
class=3DGramE>(</span>);<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>However, I get the following error from MVC++ 6.0 =
that says<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>&#8230;<span class=3DSpellE><span =
class=3DGramE>itkRayCastInterpolateImageFunction.txx</span></span><span
class=3DGramE>(</span>595) : error C2440: 'initializing' : cannot =
convert from 'const
class <span class=3DSpellE>itk::Vector</span>&lt;double,3&gt;' to 'const =
double *<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>'<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><span
style=3D'mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
</span>No
user-defined-conversion operator available that can perform this <span
class=3DGramE>conversion,</span> or the operator cannot be =
called<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><span
style=3D'mso-spacerun:yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
</span>.\..\..\Insight\InsightToolkit-1.6.0\Code\Common\<span
class=3DGramE>itkImportImageContainer.h(</span>87) : while compiling =
class-template
member function '<span class=3DSpellE>bool</span> __<span =
class=3DSpellE>thiscall</span>
<span =
class=3DSpellE>itk::RayCastInterpolateImageFunction</span>&lt;class =
<span
class=3DSpellE>itk::Image</span>&lt;double,3&gt;,double&gt;::<span =
class=3DSpellE>SetRay</span>(class
<span class=3DSpellE>itk::Point</span><o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>&lt;double<span class=3DGramE>,3</span>&gt;,class =
<span
class=3DSpellE>itk::Vector</span>&lt;double,3&gt;) =
const'<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoAutoSig><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt;mso-no-proof:yes'>So, what exactly am I doing =
wrong?<o:p></o:p></span></font></p>

<p class=3DMsoAutoSig><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt;mso-no-proof:yes'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoAutoSig><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt;mso-no-proof:yes'>Thanks for your =
help!<o:p></o:p></span></font></p>

<p class=3DMsoAutoSig><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt;mso-no-proof:yes'>-Jared<o:p></o:p></span></font></p>

<p class=3DMsoAutoSig><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt;mso-no-proof:yes'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>

------=_NextPart_000_0009_01C42DE3.EB1D2B40--