CANDELbio / mantis-viewer

Electron-based multiplexed imaging viewer
Apache License 2.0
22 stars 7 forks source link

Validate inputs for populations import #30

Closed ngreenwald closed 4 years ago

ngreenwald commented 4 years ago

The current import populations functionality doesn't raise an error message if the wrong column names are supplied, and Mantis freezes.

rj3d commented 4 years ago

Could you send me an example project and population csv for this? Mantis doesn't expect a header for this file, and should be throwing out any lines that it is unable to parse from the file. I just tried adding some bad lines to a population csv I have for a test project and couldn't get it to crash.

ngreenwald commented 4 years ago

20200615_example_data.zip Sure thing.

  1. Load Point06 as an image set
  2. Import Point06_segmentation_label as segmentation
  3. Import Point06_info, or Point06_info_sementation, as a population, and Mantis freezes. If I import the correctly formatted file (Point06_info_lineage), it works great.

I think it could make sense to require properly named headers for the csv files. Could be easier than trying to figure out if the values are incorrect for a given column. I can guarantee people are going to find creative ways to incorrectly format the CSV file.

rj3d commented 4 years ago

Awesome, thanks! That was super helpful. This should be fixed in the v1.1.0-alpha.10 release I just uploaded.

The problem was that file had thousands of 'populations'. When Mantis was trying to create thousands of populations in the main thread it would cause the UI to freeze. For now I've fixed it by asynchronously importing populations. Long term I'm planning to add a little pop up confirming that the user wants to import X populations from the selected file.

Haha, I think you're right about people finding creative ways to incorrectly format the CSV file. Hopefully asking the user to confirm the number of populations will help with that. I also added a ticket to chat with the team about requiring header names and a certain number of columns from the users.