TissueImageAnalytics / tiatoolbox

Computational Pathology Toolbox developed by TIA Centre, University of Warwick.
https://warwick.ac.uk/tia
Other
340 stars 71 forks source link

Enhance download paths in the examples notebooks #810

Closed GeorgeBatch closed 1 week ago

GeorgeBatch commented 2 months ago

Description

In the example notebooks, the files are sometimes downloaded into the examples directory instead of the examples/tmp/ directory. The examples/tmp/ is the place for downloads since it gets cleared at the start of every notebook.

What I Did

In examples/10-wsi-registration.ipynb I changed:

fixed_img_file_name = Path("fixed_image.tif")
moving_img_file_name = Path("moving_image.tif")

to

fixed_img_file_name = global_save_dir / "fixed_image.tif"
moving_img_file_name = global_save_dir / "moving_image.tif"

I wanted to make a pull request with fixes like that.

Problem: But because of the notebook format, the metadata changes when I save the notebook. Instead of a 2-line change, GitHub sees more than 100 deletions and additions. See: https://github.com/GeorgeBatch/tiatoolbox/commit/97d65b939934d5ece8091fbd72904ead080620e0

Possible solution: Maybe it's better to have the example notebooks saved without the outputs.

shaneahmed commented 2 months ago

Please go ahead and create a PR. All the notebooks are written in Colab, so if you write the notebook in Colab the metadata won't change much. You can also review the change in reviewnb. The link for reviewnb should automatically be generated when you create the PR.

GeorgeBatch commented 2 months ago

I was running them locally, will try in collab so metadata changes less.