Hi Matt,
we found out that the reason for this behavior lies in
Mitk::ImageVtkMapper2D::GenerateDataForRenderer(..)
Here the "reslicer", which is resampling the images, is creating shifted
results. The shift is only noticeable if the images are really really small
(like in your case).
Reslicer is taking an input image with its geometry and another desired
geometry. Then it "resamples" the image, so it fits to the new geometry. The
new, desired geometry is the world geometry, the smallest geometry, which
contains all existing geometries. It is created by taking the bounds of the
largest image (the 3x3 image with spacing 2,2 = world bounds are going from 0
to 6). The spacing is the lowest existing spacing (the spacing of the 5x5 image
is 1,1.. this is taken).
So the world geometry has the spacing 1,1 and 6 pixels in y and x direction.
Reslicer is now trying to resample the image with 5 pixels into an image with 6
pixels. Here it encounters a problem... visible in the pixel shift.
Possible solutions:
The world geometry is calculated in the function
mitk::DataStorage::ComputeBoundingGeometry3D
Here we could adjust that a smaller pixel spacing is taken. But it is not clear
how to determine, what would be a good pixel spacing. Actually, it could be
really really small, depending on how many images you have.
Another solution: Reconstruct the image mapper, so the images are always mapped
in their "own" geometry and the world geometry is only used to "focus" the 2D
renderwindow. But this might increase calculation time, when working with
several images. Also the 3D renderwindow mechanism won't work anymore then. So
far it takes a "texture" of the size of the world geometry, which is created in
the 2D mapper using the current reslicer mechanism and puts it onto a plane.
We are not sure how to solve the problem in a satisfying way, yet. Also it only
occurs when having really small images, so the priority of fixing is not that
high..
Sry, might have a further look when I have time again.
regards,
Bastian
On 18 May 2012, at 09:25, Graser, Bastian wrote:
Hi Matt,
This is a very interesting observation. After some consideration time, I would
say your expectations are correct. Yet, I need to consult with some other
experts on that topic. If they approve your expectations as well, we will write
a bug-report for that and try to fix it sometime soon.
Thank you for the detailed description, this is very helpful!
Regards,
Bastian
Von: Clarkson, Matt
[mailto:[email protected]]<mailto:[mailto:[email protected]]>
Gesendet: Donnerstag, 17. Mai 2012 10:58
An: mitk-users
Betreff: [mitk-users] Image Geometry & half voxel shift - Problem?
Hi Everyone,
I have a problem whereby I am seeing a half voxel shift in my millimetre to
voxel calculations, and I believe the following example using this mornings
build of ExtApp illustrates it.
I have a 3x3 test image with voxel size 2mm x 2mm, and a 5x5 test image with
voxel sizes 1mm x 1mm.
The origin for both images should be the centre of the first voxel.
If I load JUST the 3x3 image, the geometry as expected. The first voxel has
index 0,0 and millimetre location 0,0.
If I load JUST the 5x5 image, again, it is as expected.
If I load BOTH the 3x3 and the 5x5 I would expect the smaller 5x5 image to be
centred symmetrically within the 3x3 image, and this is not the case. It looks
like the corners are aligned rather than the centre of the first voxel.
Please find attached my 3x3 image and 5x5 image, and some screenshots.
In the screenshots
first screenshot = 3x3 image = OK
second screenshot = 5x5 image = OK
third screenshot = overlay = PROBLEM????
fourth screenshot = my expectation.
Did I do something wrong, or it my expected behaviour wrong?
Many thanks
Matt
<image001.png>
------------------------------------------------------
Matt Clarkson Ph.D.
CMIC Software Manager
Senior Research Associate
[email protected]<mailto:[email protected]>
Skype: drmattclarkson
Centre For Medical Image Computing
http://cmic.cs.ucl.ac.uk/staff/matt_clarkson/<http://cmic.cs.ucl.ac.uk/>
Tel: 020 7679 0177
Fax: 020 7679 0255
Dementia Research Centre
http://dementia.ion.ucl.ac.uk/
Tel: 08451 555 000 ext. 723653
Fax: 020 7676 2066
------------------------------------------------------
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users