I have a couple questions about using plastimatch. I did bspline
registration on dicom files (fixed dicom dir: CT50, moving dicom dir:
CT90).
1) Can I create a difference image using the dicom files in CT50 and
the output dicom files from the registration or does it have to be in
some other format?
2) Can I use the registration results to deform the structure contours
in the dicom RT struct file and if so how?
3) If I have a specific set of points in the fixed image, how do I use
the registration results to find their new location in the moving
image?
thanks
Erika
> Hi,
>
> I have a couple questions about using plastimatch. I did bspline
> registration on dicom files (fixed dicom dir: CT50, moving dicom dir:
> CT90).
>
> 1) Can I create a difference image using the dicom files in CT50 and
> the output dicom files from the registration or does it have to be in
> some other format?
Hmm, it looks like the input can be dicom, but the output has to be another
format. So I guess you would have to use two commands like this:
plastimatch diff dicom1 dicom2 tmp.mha
plastimatch convert --input tmp.mha --output-format dicom --output diff
>
> 2) Can I use the registration results to deform the structure contours
> in the dicom RT struct file and if so how?
>
Yep. The command is something like this:
plasmatch warp \
--xf bspline_coefficients.txt \
--input contours_in.dcm \
--output-dicom output_directory
> 3) If I have a specific set of points in the fixed image, how do I use
> the registration results to find their new location in the moving
> image?
The command is something like this:
plastimatch warp \
--xf bspline_coefficients.txt \
--input fixed_locs.fcsv \
--output-pointset warped_fixed.fcsv
Greg
--
Greg Sharp, PhD
Department of Radiation Oncology
Massachusetts General Hospital
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.
> 1) If I apply warp on CT dicom directory and try to output dicom
> files to a new directory, I get back exactly the CT input files (i.e.
> no warping performed).
I could reproduce this problem. It is a bug. I will try to fix it soon.
> 2) If I apply warp on CT dicom directory using bspline coeff and
> output to .mha, it works. If however, I use bspline_vf, a correct
> ouput .mha file seems to be created but plastimatch freezes with
> output:
>
> The directory:
>
> C:/Users/Erika/Academic/4D CT Netherlands/VMAT44_CT90_heart_dec19_ins
>
> Contains the following DICOM Series:
> 1.2.840.113619.2.181.90581109237.5897.1311337976212.1424.2112.5512512
... <snip>
> Finished rasterization.
> Warp_and_save_ss: m_ss_image->warp
> Warping ss_img.
> plm_warp_itk: xform_to_itk_vf
> Exception running vector resample filter!
>
> itk::ExceptionObject (00BBEEFC)
> Location: "class itk::Vector<float,3> *__thiscall
> itk::ImportImageContainer<unsi
> gned long,class itk::Vector<float,3> >::AllocateElements(unsigned
> long) const"
> File: c:\users\erika\slicer3d\slicer3-lib\insight\code\common
> \itkImportImageCont
> ainer.txx
> Line: 188
> Description: Failed to allocate memory for image.
>
Hmm, this is unusual, but maybe you really are running out of memory?
How much RAM do you have? Can you try closing other processes
on the computer and re-run?
> 3) I don't understand what's the difference between using bspline
> coefficients versus vector field to warp?
The bspline coefficients contain enough information to represent
the vector field, so you can use either one to do the warping.
In most cases the warping result is exactly the same.
Personally I use the bspline coefficients because it saves disk space.
But vector field is better for using with other applications.
> 4) When warping RTstruct file using your suggested commands, I'm not
> sure it works. I don't have Eclipse at the moment but using Matlab to
> do a quick check, I find only 10/18 structures have contours.
> Contours for other 8 structures have disappeared. As well, the number
> of contours/structure increases by about 50-300%. Whereas for
> manually contoured structures, the change in the # of contours/
> structure between the 2 phases is only <10% for most structures (lung
> up to 25%).
The missing structures may be a bug that Karthik just reported, and he
also sent a patch to fix. Can you try this?
I couldn't fully understand the part about extra contours/structures.
Do you mean more extra structures (with names)? Or each structure has
more contours than you expected?
> 5) For warping points, I'm not familiar with the .fcsv file format.
> Could I create a set of points in matlab, save it to a text file and
> apply the warp command? If so, would the text files be a single
> column of numbers (e.g. x1, y1, z1, x2, y2, z2..etc). Or would it be
> easier to read in the vector field to matlab instead using the
> readmha.m file provided by plastimatch?
I think there is a txt file which is also supported.
You can put one landmark on each line, like this:
x1 y1 z1
x2 y2 z2
Using readmha is also good. You just have to map the landmark
positions into the vector field, and add the displacement.
> 6) If CT50 is my fixed img and CT90 is my moving img, then I would
> apply the registration results to CT90 RTstruct to find the deformed
> contours in CT50? However, if I apply the registration results to
> point locations in CT50, this will give me their new locations in
> CT90?
Yes this is correct. Landmarks are the opposite direction
from images.
I think that you want to map the structures of the "moving" dataset on
the reference system of "fixed" dataset.
I did this task and below you find the type of commands that I executed
(I started registering the two CTs).
Are the contours stored into a dicomRT file?
If yes you can get the mha file/s by this command:
plastimatch convert --input=file_name_dicomRT --interpolation=nn
--output-type=uchar --referenced-ct=ct_directory
--output-prefix=output_directory
In this way you should have the mha file/s with the structure inside (a
mha file per each structure).
These type of contours are stored as white voxel with the black
background (so they are binary images).
Now you can warp one of this structure using this command:
plastimatch warp --input=STRU.mha --xf=vf_or_xf_file --interpolation=nn
--output-type=uchar --output-img=warped_stru.mha
This is just my experience, I don't know if there is a better way to do
this task.
Hope this helps.
Paolo.
Just to add a little more background.
You are correct that DICOM-RT structures are contained in points.
More specifically, they are points that lie on the planes of the
CT slices. If you warp the points, you get contours that no
longer lie on a single slice. Therefore, plastimatch converts
the structures into a kind of binary image, warps the image,
then re-extracts the boundary from the image. This ensures
that the new contours can lie on CT slices.
Greg
thanks
Erika
The information in this e-mail is intended only for the person to whom it is