embl-cba / microglia-morphometry

5 stars 1 forks source link

Opening output in MoBIE does not work #13

Open tischi opened 5 months ago

tischi commented 5 months ago

Following on the plugin use, I couldn’t make the Mobie explorer work like you do in the documentation: the table does not open (headers are for some reason not recognized). Could you confirm that it works for you? The interface seems to be slightly different now than the one you show on the screenshot, so I’m thinking maybe something else could have changed.

https://forum.image.sc/t/microglia-morphometry-fiji-plugin-parameters-cell-size-not-working/95045/4

tischi commented 5 months ago

I ran the segmentation and morphometry on a small crop of your data, which resulted in this folder with files: test.zip

Then in MoBIE, I could open them with

Java Code
OpenTableCommand command = new OpenTableCommand();
command.root = new File("/Users/tischer/Desktop/microglia-data/test");
command.table = new File("/Users/tischer/Desktop/microglia-data/test/test-crop-8bit-ds2.csv");
command.images = "Path_Intensities=Signal";
command.labels = "Path_LabelMasks=Segmentation";
command.removeSpatialCalibration = true;
command.run();
ImageJ GUI Screenshot
image

Can you reproduce this?

mambroset commented 5 months ago

No it does not work with the data you provided either: In the Log I get

MoBIE

Opening data from table: C:\Users\mambroset\Desktop\test\test-crop-8bit-ds2.csv [WARNING] Found duplicate column names, e.g.: 9.219544457292887 [WARNING] Trying now to open the table assuming that there are two header rows...

And in the Console: [ERROR] Command errored: Open Table... java.lang.ArrayIndexOutOfBoundsException: 1 at org.embl.mobie.lib.table.saw.TableOpener.dealWithTwoHeaderRowsIfNeeded(TableOpener.java:250) at org.embl.mobie.lib.table.saw.TableOpener.openDelimitedTextFile(TableOpener.java:220) at org.embl.mobie.lib.table.saw.TableOpener.openDelimitedTextFile(TableOpener.java:274) at org.embl.mobie.lib.SourcesFromTableCreator.(SourcesFromTableCreator.java:60) at org.embl.mobie.MoBIE.(MoBIE.java:182) at org.embl.mobie.command.open.OpenTableCommand.run(OpenTableCommand.java:105) at org.embl.mobie.command.open.OpenTableCommand.run(OpenTableCommand.java:78) at org.scijava.command.CommandModule.run(CommandModule.java:196) at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:125) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:64) at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:247) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

I'm wondering if it has to do with the way it recognizes the headers in a csv table but I have no clue where to look to fix it! Is it possible that it's a weird difference between OSs?

tischi commented 5 months ago

Yes, it is possible that the OS plays a role, in which case this is also difficult to debug for me, because I do not have access to a Windows computer.

Could you do me a favour and try whether it also does not work with the MoBIE-beta update site? This update site contains a newer version of MoBIE....

However, it indeed feels more like an OS issue, it seems like your computer does not recognise the line breaks in the CSV, that's why it considers 9.219544457292887 a column header even though that is already part of the normal table rows; super weird though...sorry, also a bit speechless right now...

mambroset commented 5 months ago

Same behavior with MoBIE-beta! I have no clue what could be wrong...

tischi commented 5 months ago

I am using the Java tablesaw library to open the tables. Seems like other people had similar issues before.

tischi commented 5 months ago

I asked also for us: https://github.com/jtablesaw/tablesaw/issues/1255

mambroset commented 5 months ago

Thanks for the dedication! I confirm that a simple workaround for now is to open and save the csv tables before opening them with MoBIE! Doing so in Fiji works perfectly fine so it's easily scriptable :).

tischi commented 5 months ago

Thanks for finding this out! This is so weird 🤯

tischi commented 5 months ago

@mambroset could you please share here with me the table after re-saving from Fiji?

mambroset commented 5 months ago

iMGL_AAV2MOI105_6h_DAPI_IBA1_well6_image2_C2.csv