LCSR-CIIS / ambf_util_slicer_plugin

some utilities for quickly converting volumes, markups from 3DSlicer into format accepted by AMBF simulator
BSD 2-Clause "Simplified" License
3 stars 3 forks source link

"Export LabelMap to PNG for AMBF" does not generate file #14

Closed Jdhaworth closed 1 year ago

Jdhaworth commented 1 year ago

Hello!

I have the plugin setup per the instructions. However, when I click the "Export LabelMap to PNG for AMBF" button the file does not generate in the selected directory. Do you know why this might be? Thanks!

htp2 commented 1 year ago

Hey Jesse. If you take a look at the terminal output, you might get a hint. (Assuming you opened Slicer from the terminal) You can also see outputs in the Python Interpreter within 3DSlicer if you press the Python button in the toolbar. See if you can get any clues from there (e.g. if there's a warning or error that prints).

Jdhaworth commented 1 year ago

Here is the terminal output: Dimensions: [234 281 278] Spacing: [0.218928 0.218928 0.218928] Number of slices: 278 Traceback (most recent call last): File "/home/jdhaworth-research/ambf/ambf_util_slicer_plugin/ambf_util_slicer_plugin/AMBF_utils.py", line 299, in onExportLabelMapButton self.onRefreshYamlButton() File "/home/jdhaworth-research/ambf/ambf_util_slicer_plugin/ambf_util_slicer_plugin/AMBF_utils.py", line 395, in onRefreshYamlButton with open(self.outputDirSelector.currentPath+"/"+self.volumeName.text+".yaml", 'r') as stream: FileNotFoundError: [Errno 2] No such file or directory: '/home/jdhaworth-research/Downloads/export test/volume.yaml'

htp2 commented 1 year ago

Hmm... It appears that the plugin currently assumes the output folder will exist, and I don't know if that's the case for you? You can try to output into a folder that exists, or use the button to open the dialog box that allows you to select a folder and I think it should have a button to add folders as well? Also, probably not the issue, but having directory names with spaces can sometimes cause issues on linux

Jdhaworth commented 1 year ago

I did select the output directory myself, so it for sure exists. I also tried renaming the folder to export_test and it produces the same error.

htp2 commented 1 year ago

Gotcha, definitely seems like some sort of race condition where that file is expected to exist but doesnt. Is the checkbox with the name like "generate yaml file" checked?

Jdhaworth commented 1 year ago

"Generate AMBF yaml" is checked.

htp2 commented 1 year ago

Can you see if that file is indeed there? Like is there a volume.yaml file?

Jdhaworth commented 1 year ago

The yaml file is not there either. If I first go to the YAML Output menu of the plugin and click "Overwrite YAML file" it will generate in the selected folder. But if I then go and select Export LabelMap, still nothing will happen and the same error appears in the terminal.

htp2 commented 1 year ago

I'm not sure what could be causing this. Can you send me an email? I can probably help via screen share easier

Jdhaworth commented 1 year ago

Are you on campus? I'm in B08. Let me first try switching back to the main branch and see if that fixes it.

Jdhaworth commented 1 year ago

I was able to get the export to work if I used a different segmentation/labelmap. I'll look into what is wrong with my segmentation that is causing this issue.

Jdhaworth commented 1 year ago

Not sure why, but once I deleted the plugin and Slicer and then reinstalled, everything works as normal.