sankeert1999 / Virtual-Orientation-Tools-VOTj

Virtual Orientation Tool FIJI (VOTj) : A Fiji plugin for object centering and alignment
MIT License
0 stars 0 forks source link

output_image_maker with Z-stack #3

Closed LauLauThom closed 1 year ago

LauLauThom commented 1 year ago

On my side converting a Z-stack to a hyperstack with the code below is not raising any issue, so I am not sure the code needs a special case for channels == 1 and dimensions = 3

# Convert a 1D stack e.g Z-stack to an ImagePlus
#@ImagePlus imp
from ij.plugin import HyperStackConverter

print "x,y,c,z,t : ", imp.getDimensions()

newImp = HyperStackConverter.toHyperStack(imp, 1 , imp.getStackSize(), 1) # czt
print "x,y,c,z,t : ", newImp.getDimensions()

newImp.setTitle("output")
newImp.show()

https://github.com/sankeert1999/Virtual_orienation_tool_FIJI/blob/f814fe1f3613dba4b78750f7c21f80945d618418/Utils.py#L466-L472

sankeert1999 commented 1 year ago

heys there i tested this with an image with the dimension xyz (RGB Color). Was getting the following error Traceback (most recent call last): File "New.py", line 22, in AttributeError: 'ij.ImagePlus' object has no attribute 'getModeAsString'_

LauLauThom commented 1 year ago

Can you test the version on the branch simpler-image-maker.

The issue was that the mode is only defined for multi-channel images.
I simplified the code in the branch above, so it always make a hyperstack for 3D BUT only set the display mode when nC > 1.
I think it much easier to understand the logic ;)

if you are happy with it we can merge the branch.
I didnt test it so there might be some small bug like variable name...

LauLauThom commented 1 year ago

Implemented with 8069342a42901806c8624c33a6558df80144bc60