No subject
Tue Jan 15 14:41:49 EST 2013
Hi Chris,
Thanks for the reply.
Your code did show what I needed to do, but I get this error
errDesc = 0x000000000a708ff0 "itk::ERROR:
TransformFileWriter(**000000000A704480):
Can't Create IO object for file C:\test.tfm"
Any ideas?
My code snippet is
transform->SetParameters( finalParameters );
try {
itk::TransformFileWriter::**Pointer writer =
itk::TransformFileWriter::New(**);
writer->SetInput(transform);
writer->SetFileName("C:\\test.**tfm");
writer->Update();
}
catch( itk::ExceptionObject & err ){
std::cerr << "ITK test driver caught an ITK
exception:\n";
err.Print(std::cerr);
const char* errDesc = err.GetDescription();
return (-1);
}
Thanks!
On Fri, Feb 22, 2013 at 11:07 AM, ronn kling <ronn at rlkling.com> wrote:
> So I tried what Chris suggested and got this error
>
> errDesc = 0x000000000a708ff0 "itk::ERROR:
> TransformFileWriter(000000000A704480): Can't Create IO object for file
> C:\test.tfm"
>
> My code snippet is
>
> transform->SetParameters( finalParameters );
>
> try {
> itk::TransformFileWriter::Pointer writer = itk::TransformFileWriter::New();
> writer->SetInput(transform);
> writer->SetFileName("C:\\test.tfm");
> writer->Update();
> }
> catch( itk::ExceptionObject & err ){
> std::cerr << "ITK test driver caught an ITK exception:\n";
> err.Print(std::cerr);
> const char* errDesc = err.GetDescription();
> return (-1);
> }
> Thanks!
>
>
> On Mon, Feb 18, 2013 at 10:00 AM, Christopher Mullins <
> christopher.mullins at kitware.com> wrote:
>
>> I actually did exactly this in one of my projects [1]. Take a look, and
>> let me know if this isn't what you're trying to do. There's probably a
>> more generic example of doing this here [2].
>>
>> [1]
>> https://github.com/chrismullins/VesselRegistration/blob/master/vesselRegistration.cxx#L98
>> [2]
>> http://www.na-mic.org/svn/Slicer3-lib-mirrors/trunk/Insight/Examples/IO/TransformReadWrite.cxx
>>
>>
>> On Mon, Feb 18, 2013 at 10:21 AM, ronn kling <ronn at rlkling.com> wrote:
>>
>>> All,
>>>
>>> I'm new to ITK, so I may be asking a simple question.
>>>
>>> I'm successfully registering two volumes with VersorRigid3DTransform.
>>> What I want to do is save the transform to disk so that the next time I
>>> read the two volumes in I can just apply the transform and go on my merry
>>> way. The problem is, I don't see how to do it. My first thought was that
>>> I could save the versor and then reload it into the ResampleImageFilter,
>>> but I don't see how to do that.
>>>
>>> If someone could point me to an example or a previous post on this list,
>>> I would appreciate it.
>>>
>>> _____________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Kitware offers ITK Training Courses, for more information visit:
>>> http://www.kitware.com/products/protraining.php
>>>
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-users
>>>
>>>
>>
>>
>> --
>> Christopher Mullins
>> R&D Engineer
>> Kitware Inc.,
>> 919.869.8871
>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.php
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>>
>
--
Christopher Mullins
R&D Engineer
Kitware Inc.,
919.869.8871
--f46d0438ee61e0897904d6527818
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Thanks for keeping responses on the list!<div style>From R=
onn:</div><div style><br></div><div style><span style=3D"font-family:arial,=
sans-serif;font-size:13px">Hi Chris,</span><br style=3D"font-family:arial,s=
ans-serif;font-size:13px">
<br style=3D"font-family:arial,sans-serif;font-size:13px"><span style=3D"fo=
nt-family:arial,sans-serif;font-size:13px">Thanks for the reply.</span><br =
style=3D"font-family:arial,sans-serif;font-size:13px"><br style=3D"font-fam=
ily:arial,sans-serif;font-size:13px">
<span style=3D"font-family:arial,sans-serif;font-size:13px">Your code did s=
how what I needed to do, but I get this error</span><br style=3D"font-famil=
y:arial,sans-serif;font-size:13px"><br style=3D"font-family:arial,sans-seri=
f;font-size:13px">
<span style=3D"font-family:arial,sans-serif;font-size:13px">errDesc =3D 0x0=
00000000a708ff0 "itk::ERROR: TransformFileWriter(</span><u style=3D"fo=
nt-family:arial,sans-serif;font-size:13px"></u><span style=3D"font-family:a=
rial,sans-serif;font-size:13px">000000000A</span><span style=3D"font-family=
:arial,sans-serif;font-size:13px">704480): Can't Create IO object for f=
ile C:\test.tfm"</span><br style=3D"font-family:arial,sans-serif;font-=
size:13px">
<br style=3D"font-family:arial,sans-serif;font-size:13px"><span style=3D"fo=
nt-family:arial,sans-serif;font-size:13px">Any ideas?</span><br style=3D"fo=
nt-family:arial,sans-serif;font-size:13px"><br style=3D"font-family:arial,s=
ans-serif;font-size:13px">
<span style=3D"font-family:arial,sans-serif;font-size:13px">My code snippet=
is</span><br style=3D"font-family:arial,sans-serif;font-size:13px"><br sty=
le=3D"font-family:arial,sans-serif;font-size:13px"><span style=3D"font-fami=
ly:arial,sans-serif;font-size:13px">=A0 =A0 =A0 =A0 transform->SetParame=
ters( finalParameters );</span><br style=3D"font-family:arial,sans-serif;fo=
nt-size:13px">
<br style=3D"font-family:arial,sans-serif;font-size:13px"><span style=3D"fo=
nt-family:arial,sans-serif;font-size:13px">=A0 =A0 =A0 =A0 try {</span><br =
style=3D"font-family:arial,sans-serif;font-size:13px"><span style=3D"font-f=
amily:arial,sans-serif;font-size:13px">=A0 =A0 =A0 =A0 itk::TransformFileWr=
iter::</span><u style=3D"font-family:arial,sans-serif;font-size:13px"></u><=
span style=3D"font-family:arial,sans-serif;font-size:13px">Poin</span><span=
style=3D"font-family:arial,sans-serif;font-size:13px">ter writer =3D itk::=
TransformFileWriter::New(</span><u style=3D"font-family:arial,sans-serif;fo=
nt-size:13px"></u><span style=3D"font-family:arial,sans-serif;font-size:13p=
x">);</span><br style=3D"font-family:arial,sans-serif;font-size:13px">
<span style=3D"font-family:arial,sans-serif;font-size:13px">=A0writer->S=
etInput(transform);</span><br style=3D"font-family:arial,sans-serif;font-si=
ze:13px"><span style=3D"font-family:arial,sans-serif;font-size:13px">=A0wri=
ter->SetFileName("C:\\</span><span style=3D"font-family:arial,sans-=
serif;font-size:13px">test.</span><u style=3D"font-family:arial,sans-serif;=
font-size:13px"></u><span style=3D"font-family:arial,sans-serif;font-size:1=
3px">tfm");</span><br style=3D"font-family:arial,sans-serif;font-size:=
13px">
<span style=3D"font-family:arial,sans-serif;font-size:13px">=A0writer->U=
pdate();</span><br style=3D"font-family:arial,sans-serif;font-size:13px"><s=
pan style=3D"font-family:arial,sans-serif;font-size:13px">=A0 =A0 =A0 =A0 }=
</span><br style=3D"font-family:arial,sans-serif;font-size:13px">
<span style=3D"font-family:arial,sans-serif;font-size:13px">=A0 =A0 =A0 =A0=
catch( itk::ExceptionObject & err ){</span><br style=3D"font-family:ar=
ial,sans-serif;font-size:13px"><span style=3D"font-family:arial,sans-serif;=
font-size:13px">=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0std::cerr << &=
quot;ITK test driver caught an ITK exception:\n";</span><br style=3D"f=
ont-family:arial,sans-serif;font-size:13px">
<span style=3D"font-family:arial,sans-serif;font-size:13px">=A0 err.Print(s=
td::cerr);</span><br style=3D"font-family:arial,sans-serif;font-size:13px">=
<span style=3D"font-family:arial,sans-serif;font-size:13px">=A0 const char*=
errDesc =3D err.GetDescription();</span><br style=3D"font-family:arial,san=
s-serif;font-size:13px">
<span style=3D"font-family:arial,sans-serif;font-size:13px">=A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 return (-1);</span><br style=3D"font-family:arial,sans-ser=
if;font-size:13px"><span style=3D"font-family:arial,sans-serif;font-size:13=
px">=A0 =A0 =A0 =A0 }</span><br style=3D"font-family:arial,sans-serif;font-=
size:13px">
<br style=3D"font-family:arial,sans-serif;font-size:13px"><span style=3D"fo=
nt-family:arial,sans-serif;font-size:13px">Thanks!</span><br></div></div><d=
iv class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Fri, Feb 22,=
2013 at 11:07 AM, ronn kling <span dir=3D"ltr"><<a href=3D"mailto:ronn@=
rlkling.com" target=3D"_blank">ronn at rlkling.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">So I tried what Chris sugge=
sted and got this error<div class=3D"im"><div><br></div><div>errDesc =3D 0x=
000000000a708ff0 "itk::ERROR: TransformFileWriter(000000000A704480): C=
an't Create IO object for file C:\test.tfm"<br>
</div><div><br></div></div><div class=3D"im"><div>My code snippet is=A0</di=
v><div><br></div><div>transform->SetParameters( finalParameters );<br><b=
r>try=20
{<br>itk::TransformFileWriter::Pointer writer =3D=20
itk::TransformFileWriter::New();<br> writer->SetInput(transform);<br> =
=20
writer->SetFileName("C:\\test.tfm");<br> writer->Update();=
<br>}<br>catch(=20
itk::ExceptionObject & err ){<br> std::cerr << "ITK test d=
river=20
caught an ITK exception:\n";<br> err.Print(std::cerr);<br> const c=
har*=20
errDesc =3D err.GetDescription();<br>return (-1);<br>}<br></div><div>Thanks=
!</div></div></div><div class=3D"HOEnZb"><div class=3D"h5"><div class=3D"gm=
ail_extra"><br><br><div class=3D"gmail_quote">On Mon, Feb 18, 2013 at 10:00=
AM, Christopher Mullins <span dir=3D"ltr"><<a href=3D"mailto:christophe=
r.mullins at kitware.com" target=3D"_blank">christopher.mullins at kitware.com</a=
>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">I actually did exactly this=
in one of my projects [1]. =A0Take a look, and let me know if this isn'=
;t what you're trying to do. =A0There's probably a more generic exa=
mple of doing this here [2].<div>
<br>
</div><div>[1]=A0<a href=3D"https://github.com/chrismullins/VesselRegistrat=
ion/blob/master/vesselRegistration.cxx#L98" target=3D"_blank">https://githu=
b.com/chrismullins/VesselRegistration/blob/master/vesselRegistration.cxx#L9=
8</a></div>
<div>[2]=A0<a href=3D"http://www.na-mic.org/svn/Slicer3-lib-mirrors/trunk/I=
nsight/Examples/IO/TransformReadWrite.cxx" target=3D"_blank">http://www.na-=
mic.org/svn/Slicer3-lib-mirrors/trunk/Insight/Examples/IO/TransformReadWrit=
e.cxx</a></div>
</div><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote"><div><d=
iv>On Mon, Feb 18, 2013 at 10:21 AM, ronn kling <span dir=3D"ltr"><<a hr=
ef=3D"mailto:ronn at rlkling.com" target=3D"_blank">ronn at rlkling.com</a>></=
span> wrote:<br>
</div></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div><div><div dir=3D"ltr"><span=
style=3D"font-family:arial,sans-serif;font-size:13px">All,</span><div styl=
e=3D"font-family:arial,sans-serif;font-size:13px">
<br></div><div style=3D"font-family:arial,sans-serif;font-size:13px">I'=
m new to ITK, so I may be asking a simple question.</div>
<div style=3D"font-family:arial,sans-serif;font-size:13px"><br></div><div s=
tyle=3D"font-family:arial,sans-serif;font-size:13px">I'm successfully r=
egistering two volumes with VersorRigid3DTransform. =A0What I want to do is=
save the =A0transform to disk so that the next time I read the two volumes=
in I can just apply the transform and go on my merry way. =A0The problem i=
s, I don't see how to do it. =A0My first thought was that I could save =
the versor and then reload it into the ResampleImageFilter, but I don't=
see how to do that. =A0</div>
<div style=3D"font-family:arial,sans-serif;font-size:13px"><br></div><div s=
tyle=3D"font-family:arial,sans-serif;font-size:13px">If someone could point=
me to an example or a previous post on this list, I would appreciate it.</=
div>
</div>
<br></div></div>_____________________________________<br>
Powered by <a href=3D"http://www.kitware.com" target=3D"_blank">www.kitware=
.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href=3D"http://www.kitware.com/opensource/opensource.html" target=3D"_bl=
ank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href=3D"http://www.kitware.com/products/protraining.php" target=3D"_blan=
k">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href=3D"http://www.itk.org/Wiki/ITK_FAQ" target=3D"_blank">http://www.it=
k.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href=3D"http://www.itk.org/mailman/listinfo/insight-users" target=3D"_bl=
ank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><span><font color=3D"#888888"><br><br clear=3D"all">=
<div><br></div>-- <br>Christopher Mullins<div>R&D Engineer</div><div>Ki=
tware Inc.,</div><div><a href=3D"tel:919.869.8871" value=3D"+19198698871" t=
arget=3D"_blank">919.869.8871</a></div>
</font></span></div>
<br>_____________________________________<br>
Powered by <a href=3D"http://www.kitware.com" target=3D"_blank">www.kitware=
.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href=3D"http://www.kitware.com/opensource/opensource.html" target=3D"_bl=
ank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href=3D"http://www.kitware.com/products/protraining.php" target=3D"_blan=
k">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href=3D"http://www.itk.org/Wiki/ITK_FAQ" target=3D"_blank">http://www.it=
k.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href=3D"http://www.itk.org/mailman/listinfo/insight-users" target=3D"_bl=
ank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>=
Christopher Mullins<div>R&D Engineer</div><div>Kitware Inc.,</div><div>=
919.869.8871</div>
</div>
--f46d0438ee61e0897904d6527818--
More information about the Insight-users
mailing list