CellMigrationLab / Fast4DReg

Fast4DReg is a Fiji script for quick drift correction in time-lapse 3D-stacks. The script can be used to correct drift in all x-, y- and/or z-directions.
MIT License
37 stars 3 forks source link

Stack to hyperstack error #4

Closed GolgiWhillikers closed 2 years ago

GolgiWhillikers commented 2 years ago

Hi-

I've tried to run the estimate+apply on a single channel image with 6 time points and 29 z slices per time points (hyperstack). On running the plugin and choosing the best for live options, the script errors at line 289

Screen Shot 2022-10-14 at 4 01 15 PM

I played around with copying the macro and editing lines, and it seems like the issue is arising from the various sections that are swapping channels to time. If I comment all of these out, I have no issues. I was also getting lots of NanoJ warnings about it being optimized for pure stacks with the base plugin that went away when I commented out the hyperstack reordering.

I didn't try too hard to follow why the stacks might get reordered. Is this an issue with my input file format, or something I'm missing in the file organization? From what I'd read, the plugin would take a c=1 z=n slices t=n frames hyperstack.

Here is the debug output:

Memory 1920MB of 7749MB (24%) nImages() 8 getTitle() "AllStarStack" extend_stack_to_fit (g) 1 time_z (g) 1 crop_output (g) 1 projection_type_xy (g) "Max Intensity" z_registration (g) 1 reference_z (g) "previous frame (better for live)" max_z (g) 0 max_xy (g) 0 ram_conservative_mode (g) 0 projection_type_z (g) "Max Intensity" files (g) array[1] exp_nro (g) 1 time_xy (g) 1 XY_registration (g) 1 reslice_mode (g) "Top" reference_xy (g) "previous frame (better for live)" MonthNames array[12] year "2022" month 9 week 5 day 14 hour 15 min 59 sec 24 msec 620 timeStamp "2022-Oct-14-001" t_start 1665777564620.0000 p 0 p_start 1665777564620.0000 options "open=[/Users/(username)/Desktop/untitled folder/C3.tif] autoscale color_mode=Default ..." width 1024 height 1024 channels 6 slices 29 frames 1 filename_no_extension "C3" results "/Users/(username)/Desktop/untitled folder/C3_2022-Oct-14-001/" settings_file_path "/Users/(username)/Desktop/untitled folder/C3_2022-Oct-14-001/C3_settings.csv" DriftTable_path_XY "/Users/(username)/Desktop/untitled folder/C3_2022-Oct-14-001/C3-Max Intensityxy" DriftTable_path_Z "/Users/(username)/Desktop/untitled folder/C3_2022-Oct-14-001/C3-Max Intensity-Topz" thisTitle "C3.tif" i * 29


Error: channels x slices x frames <> stack size in line 289:

    run ( "Stack to Hyperstack..." , "order=xyctz channels=1 slices=" + slices + " frames=" + frames + " display=Color" <)>...
guijacquemet commented 2 years ago

hi @GolgiWhillikers ,

Thanks a lot for reaching out and for trying Fast4dReg,

Could you confirm that your hyperstack metadata is correct? (In image - properties) a correct number of Z frames, channels, and time points?

Cheers

Guillaume

jpylvanainen commented 2 years ago

Hi @GolgiWhillikers ,

Thanks so much for testing Fast4DReg!

I did a bit of testing and was able to reproduce your error. It seems like you are using the wrong script for your data type. For time-lapse videos (which you have), you should use the time_estimate+apply script, not the channels_estiimate+apply script.

Please try if this fixes the error - and if not, let's find a solution together!

Cheers, Joanna

GolgiWhillikers commented 2 years ago

Ah, yes. This does, of course, work totally correctly when I choose the correct script. Perhaps I should read the directions a bit more closely...

Thanks