Wojciech Lassmann
2017-03-23 18:12:23 UTC
Hi I am trying to paint an mitkimage, by mouse clicking and dragging.
(painting both the image and the rendered part would be nice).
To do this I am trying to use ImagePixelWriteAccessor but i dont really
know how to use it.
The example shown in http://docs.mitk.org/nightly/MitkImagePage.html says
itk::Index<2> idx = {{ 12, 34 }};
mitk::ImagePixelWriteAccessor<short,2> writeAccess(image,
image->GetSliceData(4));
writeAccess.SetPixelByIndex(idx, 42);
while the documentatiom says
void SetPixelByIndex
<http://docs.mitk.org/nightly/classmitk_1_1ImagePixelWriteAccessor.html#a7362a491a7724bbdb225abff1337648a>
(const itk::Index <http://docs.mitk.org/nightly/classitk_1_1Index.html><
VDimension > &idx, const TPixel &value)
as I understand, the ImagePixelWriteAccessor first asks for an image and a
slice, and than allows to set a certain pixel of itk::Index
<http://docs.mitk.org/nightly/classitk_1_1Index.html> coordinates with
TPixel value which basically say how grey-ish is it.
1 how can i get the current slice data that is in render window (4 doesn't
seem like good hint)?
2 where do I get the itk::Index
<http://docs.mitk.org/nightly/classitk_1_1Index.html> from (mousePressed->x
and y vary on the size of the screen while image dimension is an int).
3 what is TPixel - cant find any documentation of it. Looks like an int,
but is it?
With regards,
Wojciech Lassmann
(painting both the image and the rendered part would be nice).
To do this I am trying to use ImagePixelWriteAccessor but i dont really
know how to use it.
The example shown in http://docs.mitk.org/nightly/MitkImagePage.html says
itk::Index<2> idx = {{ 12, 34 }};
mitk::ImagePixelWriteAccessor<short,2> writeAccess(image,
image->GetSliceData(4));
writeAccess.SetPixelByIndex(idx, 42);
while the documentatiom says
void SetPixelByIndex
<http://docs.mitk.org/nightly/classmitk_1_1ImagePixelWriteAccessor.html#a7362a491a7724bbdb225abff1337648a>
(const itk::Index <http://docs.mitk.org/nightly/classitk_1_1Index.html><
VDimension > &idx, const TPixel &value)
as I understand, the ImagePixelWriteAccessor first asks for an image and a
slice, and than allows to set a certain pixel of itk::Index
<http://docs.mitk.org/nightly/classitk_1_1Index.html> coordinates with
TPixel value which basically say how grey-ish is it.
1 how can i get the current slice data that is in render window (4 doesn't
seem like good hint)?
2 where do I get the itk::Index
<http://docs.mitk.org/nightly/classitk_1_1Index.html> from (mousePressed->x
and y vary on the size of the screen while image dimension is an int).
3 what is TPixel - cant find any documentation of it. Looks like an int,
but is it?
With regards,
Wojciech Lassmann