axondeepseg / axondeepseg

Axon/Myelin segmentation using Deep Learning
https://axondeepseg.rtfd.io/
MIT License
115 stars 32 forks source link

CLI morphometrics doesn't generate index images #553

Closed hermancollin closed 2 years ago

hermancollin commented 3 years ago

Describe the bug Using the axondeepseg_morphometrics script and specifying folders with the -i option produces an unwanted behavior.

  1. we get the following message (which is peculiar because the xlsx file is saved and look normal)
    Cannot save morphometrics data in file 'paasu_img2_axon_morphometrics.xlsx'.`
  2. "index" images are not generated

The first point was reported by @mathieuboudreau last week when he tried to run morphometrics via the CLI with subfolders, similar to what is described here.

When running the script directly in the folder containing the segmentation, we do not encounter this problem and the index files are generated as expected.

Platform (please complete the following information):

Stoyan-I-A commented 3 years ago

I'm looking at the section of code that starts here.

It's a bit hard to follow how variables with paths are used. I admit I haven't tested the -i option when implementing the index images.

hermancollin commented 2 years ago

Ok so the main reason why this was confusing is because of this except block: https://github.com/axondeepseg/axondeepseg/blob/443c0579f417f8b1d0046e3904f9d54220b6091e/AxonDeepSeg/morphometrics/launch_morphometrics_computation.py#L237-L239

where the error is caught but not re-raised again. This should be fixed.