background_val

53 views
Skip to first unread message

Alexandra Cunliffe

unread,
Apr 23, 2012, 1:31:49 PM4/23/12
to Plastimatch
Hi,

I'm having trouble with the command "background_val" in my command
file. With this command, I am trying to set all pixels in the output
image without a specified value to -10000. Specifically, I would like
the border of the image and the top and bottom slices to have values
of -10000 when areas of the scan to be registered do not exist in
these locations. However, my output images often have a border and top/
bottom slices with 0 HU pixels. The default background pixel value is
supposed to be -999, so I'm not sure why I am seeing this. My mhd file
for a simple example is below. Maybe you could tell me if I am
misusing or misunderstanding this command?

Also, I just updated plastimatch, so I am using the most current
version.

Thank you,
Alex Cunliffe

# command_file.txt
[GLOBAL]
fixed=/fixed.mhd
moving=/moving.mhd
img_out=out.mhd
xform_out=/xform_out.mhd

[STAGE]
xform=translation
optim=rsg
max_its=30
res=10 10 5
background_val=-10000

[STAGE]
xform=translation
optim=rsg
max_its=100
res=4 4 2
background_val=-10000

Paolo Zaffino

unread,
Apr 23, 2012, 1:53:03 PM4/23/12
to plast...@googlegroups.com
Dear Alexandra,

for the border issue I solved using the matlab function "delete_edges.m"
that you can find into the extra/matlab plastimatch directory.
If you prefer there is a way to do this using python (that is free).
Anyway check always the results, because this is only a "patch" (the
code assumes that the registration is fine).

For the other one problem I don't know...I have never used that feature,
I'm sorry.

Hope this helps.
Regards.

Paolo

Sharp, Gregory C.

unread,
Apr 24, 2012, 10:29:07 AM4/24/12
to plast...@googlegroups.com
Hi Alex,

Regarding the failure of background_val, this seems to be a bug.
Should be an easy fix, but we should wait until Tony finishes the
code reorganization.

Another possible workaround is to create the xform, then warp afterward
using "plastimatch warp" with --default-value option.

Greg

Dear Alexandra,

Hope this helps.
Regards.

Paolo

The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

Alexandra Cunliffe

unread,
May 2, 2012, 2:43:56 PM5/2/12
to Plastimatch
Thanks for the options!
Would you mind alerting the group when the code reorganization is
finished?

Thanks!
Alex
> contains patient information, please contact the Partners Compliance HelpLine athttp://www.partners.org/complianceline. If the e-mail was sent to you in error

Sharp, Gregory C.

unread,
May 4, 2012, 3:59:19 PM5/4/12
to plast...@googlegroups.com
Hi Alex,

I made the fix.

If you are on linux, you can probably update and try. Windows is still
kind of iffy. I advise to save a copy of your existing build before
trying the update.

Alexandra Cunliffe

unread,
Jun 13, 2012, 11:49:27 AM6/13/12
to plast...@googlegroups.com
Hi,
Thanks for letting me know. I just tried updating and had a few problems, so I'm not sure if the fix was actually installed on my computer. The output from the update is below. Currently, I am at revision 3654, and running plastimatch version 1.5.4-beta (2737)

When I perform registration, I still encounter the same issue. I specify background_val=-10000 in the parameter file, but the borders of the scan have 0 values.

Output from update:
make
[  1%] Built target lbfgs
[  2%] Built target bstrlib
[  3%] Built target devillard
[  3%] Built target nocedal
[ 13%] Built target lua_library_static
[ 13%] Built target specfun
[ 16%] Built target plmsys
[ 42%] Built target plmbase
[ 53%] Built target plmutil
[ 54%] Built target plmclp
[ 56%] Built target plmdose
[ 66%] Built target plmregister
[ 69%] Built target plmsegment
[ 71%] Built target plmreconstruct
[ 74%] Built target plmscript
Linking CXX executable ../../../landmark_warp
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `tgetstr'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `tputs'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `BC'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `tgetent'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `tgetflag'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `tgoto'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `UP'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `tgetnum'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libreadline.so: undefined reference to `PC'
collect2: ld returned 1 exit status
make[2]: *** [landmark_warp] Error 1
make[1]: *** [src/plastimatch/cli/CMakeFiles/landmark_warp.dir/all] Error 2
make: *** [all] Error 2

Sharp, Gregory C.

unread,
Jun 13, 2012, 1:22:18 PM6/13/12
to plast...@googlegroups.com
Hi,

Your plastimatch update didn't compile, so that's why you
don't see the new behavior for background_val. Specifically, when
you see the version is (2737), that is the SVN revision.

I did some web searching, and it looks like it's possible that
you need to install the following packages:

libtermcap and libtermcap-devel

then, re-run cmake and give it another go.
(Not sure if this will work, so keeping my fingers crossed...)

-Greg

________________________________
<http://www.partners.org/complianceline> . If the e-mail was sent to you in

Alexandra Cunliffe

unread,
Jun 14, 2012, 3:42:28 PM6/14/12
to plast...@googlegroups.com
Hi Greg,

We have the packages that you mentioned already installed.

It looks like the problem may actually be that there is no linking to the ncurses library. When I add -lncurses to link.txt in landmark_warp.dir, this part compiles with no problem. I'm getting the same error later on for plastimatch.dir, bragg_curve.dir, and maybe others.

Thanks!
Alex


On Wednesday, June 13, 2012 12:22:18 PM UTC-5, Sharp, Gregory C. wrote:
Hi,

Your plastimatch update didn't compile, so that's why you
don't see the new behavior for background_val.  Specifically, when
you see the version is (2737), that is the SVN revision.

I did some web searching, and it looks like it's possible that
you need to install the following packages:

libtermcap and libtermcap-devel

then, re-run cmake and give it another go.
(Not sure if this will work, so keeping my fingers crossed...)

-Greg

________________________________

Sharp, Gregory C.

unread,
Jun 14, 2012, 6:03:24 PM6/14/12
to plast...@googlegroups.com
Hi Alex,
 
I think I could fix it.  Do you mind updating and trying again?
 
Thank you,
Greg


From: plast...@googlegroups.com [mailto:plast...@googlegroups.com] On Behalf Of Alexandra Cunliffe
Sent: Thursday, June 14, 2012 3:42 PM
To: plast...@googlegroups.com
Subject: Re: [Plastimatch] Re: background_val

Reply all
Reply to author
Forward
0 new messages