mastodon-sc / mastodon-pasteur

Mastodon plugins developed in the context of Pasteur users projects.
BSD 2-Clause "Simplified" License
2 stars 2 forks source link

Add possibility to Import Links #15

Closed stefanhahmann closed 4 weeks ago

stefanhahmann commented 3 months ago

User Story

The importer currently lets users import spots from a simple and commonly used csv file into Mastodon. This way, users can use Mastodon’s visualization and analysis tools.

The figure shows where to find the CSV importer grafik

Currently, users can select a .csv file from the file system. The importer displays the first line (aka header) of the file and lets users choose the correct order for the columns (like x, y, z, frame, label) without having to modify the csv file.

However, the “CSV Importer” can only import spots. It can’t handle links or cell divisions, which makes it very difficult to import anything that has been tracked outside of Mastodon. It may be be beneficial, if the functionality of importing links would be implemented into the CSV importer.

The figure shows the CSV importer in action and the result (unlinked spots)

grafik

Tasks:

tinevez commented 3 months ago

A CSV file is not suitable for links. I would recommend relying on the GraphML format instead.

stefanhahmann commented 3 months ago

A CSV file is not suitable for links. I would recommend relying on the GraphML format instead.

But this is how I imported these data sets into Mastodon: https://github.com/mastodon-sc/mastodon-example-data/tree/master/astec

GraphML is also a good idea, but it is more difficult to communicate, which attributes, we expect to be set in the GraphML file.

tinevez commented 3 months ago

Ok this is convincing. A good test would be to see whether we can reimport fully the CSV files generated with the CSV export of the table views.

stefanhahmann commented 3 months ago

A good test would be to see whether we can reimport fully the CSV files generated with the CSV export of the table views.

Exactly. Johannes, who was asking for this feature, and I had the same idea.

tinevez commented 3 months ago

Would you have a smallish couple of CSV files I could play with?

stefanhahmann commented 3 months ago

Yes. This Zip-File contains a spot.csv and a matching links.csv

Pm01.zip

If imported correctly, the result should be close to https://github.com/mastodon-sc/mastodon-example-data/blob/master/astec/Pm01.mastodon

I did the import using https://github.com/mastodon-sc/mastodon-deep-lineage/blob/master/src/test/java/org/mastodon/mamut/astec/AstecReader.java

stefanhahmann commented 3 months ago

Here is a 2nd example: Pm02.zip

After import, it should be similar to https://github.com/mastodon-sc/mastodon-example-data/blob/master/astec/Pm02.mastodon

stefanhahmann commented 3 months ago

However, these file have not been created with the Mastodon CSV export.

stefanhahmann commented 3 months ago

A good test would be to see whether we can reimport fully the CSV files generated with the CSV export of the table views.

Exactly. Johannes, who was asking for this feature, and I had the same idea.

Re-importing the CSV files produced with the Mastodon CSV Export function, is actually a bit harder, since these files have 3 header lines instead of only 1.

stefanhahmann commented 4 weeks ago

Resolved via #16