Hi again!
Regarding 1: Since you would change the physical extents of the image you
should never ever do this. If it is crucial for some strange reason that you
really need a uniform spacing you would have to resample the image accordingly
which would change the spacing to 1 but also the number of pixels in affected
axes. Resampling is generally a loss of information. Don't do it if you don't
need to. In MITK you can use the geometry of an image to convert between
indices, continuous indices, and world coordinates (see our documentation of
Geometries). That's the way to go.
Regarding 2: This is exactly what I was writing about in my last mail. What you
see are the physical world coordinates of the image, i.e., mm. Since the origin
is slightly negative (this is the pixel corner) I assume that the values are
the half spacings in each direction (remember center based?). This means the
center of the first pixel would be [0, 0, 0]. I further guess your spacing is
[0.429688, 0.429688, 1] then. Multiplied by [512, 512, 1319] and added to the
origin you get [219.785, 219.785, 1318.5]. Nothing magic is happening here.
You should definitely get familiar with the concept of spacing, world
coordinates and indices before you continue to work with medical image data,
e.g., read the ITK or MITK documentation about these topics.
Best,
Stefan
Von: Jatin Nath [mailto:jatin.nath.bm...@iitbhu.ac.in]
Gesendet: Dienstag, 18. März 2014 12:21
An: Kislinskiy, Stefan
Cc: mitk-users@lists.sourceforge.net
Betreff: Re: [mitk-users] bounding object cropped dimensions mismatch ?
hi,
thanks stefan for that insight.I would like to ask 2 more questions.
1) I am just hoping that there could be a way to set the spacing of X and Y as
1 without it having a negative effect on the output image quality ?can it be
done?
2)Also, Can anybody explain what the lines pasted below mean and/or if it has
any relevant documentation about it. I get these as i try to run the program. I
am guessing it could be related to actual input image bounds ? but since the
image has a dimension of 512X512X1319, the X and Y s still dont make much
sense. Is there a direct corelation or a calculation that is performed inside
MITK ?
[2.560] [mitkItkImageFileReader] [219.785, 219.785, 1318.5]
[2.560] [mitkItkImageFileReader] [-0.214844, -0.214844, -0.5]
[2.560] [mitkItkImageFileReader] number of image components: 1
[2.560] [mitkItkImageFileReader] ...finished!
Thanks and best regards,
On Tue, Mar 18, 2014 at 11:49 AM, Kislinskiy, Stefan
<s.kislins...@dkfz-heidelberg.de<mailto:s.kislins...@dkfz-heidelberg.de>> wrote:
Hi,
a first guess would be that you mix up indices with world coordinates and Z
just seems to work coincidentally since it might have a spacing of 1. As an
additional note be careful when working with world coordinates and indices in
parallel as pixel coordinates are center-based, e.g., a pixel with extents [1,
1, 1] in world coordinates at the origin has the bounds [-0.5, 0.5, -0.5, 0.5,
-0.5, 0.5] in world coordinates.
Cheers,
Stefan
________________________________________
Von: Jatin Nath
[jatin.nath.bm...@iitbhu.ac.in<mailto:jatin.nath.bm...@iitbhu.ac.in>]
Gesendet: Dienstag, 18. März 2014 11:33
An: mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net>
Betreff: [mitk-users] bounding object cropped dimensions mismatch ?
hey mitk users,
I am working on cropping a bounding object from a 3D mitk image. I have used
the mitk::boundingobjectcutter class and am confused with the output I get from
the cropping.
I manually enter the bounds for the bounding object which are the 6 parameters
in the form xmin, xmax, ymin, ymax, zmin, zmax. I am having trouble explaining
the output image dimensions that I recieve.
my input impage has a dimenion : 512X512X1320
bounds parameters : 50 100 60 150 10 1150
output dimensions : 116 209 1140
as the output object according to me shoulde have dimensions in X as xmax -
xmin, Y as ymax - ymin and Z as zmax- zmin.
the output dimension for the Z axis seems to be the way I expect but X and Y
axes give out "weird" values of 106 and 209 respectively.
Can anybody explain this behaviour ? Is there another way to do the cropping ?
Thanks in advance,
Jatin Nath,
School of BioMedical Engineering,
Indian Institute of Technology (Banaras Hindu University), Varanasi
--
Jatin Nath,
School of BioMedical Engineering,
Indian Institute of Technology (Banaras Hindu University), Varanasi
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users