Profile on scaled images not working
Hi @haesleinhuepf , not sure if this is expected, but I am observing a weird behavior when trying to make a plot profile after adding this image to the viewer:
from napari.viewer import Viewer
from aicsimageio import AICSImage
from aicsimageio.readers import BioformatsReader
fname = 'path-to-tif-file'
image = AICSImage(fname, reader=BioformatsReader)
napari_viewer = Viewer()
napari_viewer.add_image( image.data, name='image', colormap='blue')
napari_viewer.add_image( image.data,
name='image_scaled',
scale=(
image.physical_pixel_sizes.Z/image.physical_pixel_sizes.X,
1,
1
)
colormap='green'
)
All I did in the second image, is scale the Z dimension to account for the anisotropy.
As you can see, the blue and green profiles are different. I had a look at this solved issue but could not find a straightforward solution.
On a similar note, when adding the image to the viewer to take into account the XYZ voxel size:
from napari.viewer import Viewer
from aicsimageio import AICSImage
from aicsimageio.readers import BioformatsReader
fname = 'path-to-tif-file'
image = AICSImage(fname, reader=BioformatsReader)
napari_viewer = Viewer()
napari_viewer.add_image( image.data,
name='image_scaled',
scale=image.physical_pixel_sizes,
colormap='blue'
)
I do not obtain any plot profile:
Thanks so much for any help/suggestion!
EDIT: I realize the first example is not ideal because, in the same viewer, the planes visualized are not the same due to the different Z scaling. So, here is a better example:
from napari.viewer import Viewer
from aicsimageio import AICSImage
from aicsimageio.readers import BioformatsReader
fname = 'path-to-tif-file'
image = AICSImage(fname, reader=BioformatsReader)
napari_viewer1 = Viewer()
napari_viewer1.add_image( image.data, name='image', colormap='blue')
napari_viewer2 = Viewer()
napari_viewer2.add_image( image.data,
name='image_scaled',
scale=(
image.physical_pixel_sizes.Z/image.physical_pixel_sizes.X,
1,
1
)
colormap='green'
)
Which produces those two different plot profiles (now looking at the same Z plane).