Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loading of TIF 16bits grayscale files #1107

Merged
merged 6 commits into from
Mar 28, 2022
Merged

Conversation

mariehbourget
Copy link
Member

Checklist

GitHub

  • I've given this PR a concise, self-descriptive, and meaningful title
  • I've linked relevant issues in the PR body
  • I've applied the relevant labels to this PR
  • I've assigned a reviewer

PR contents

Description

This PR fixes issue #1105 where TIF 16bits grayscale gave an error while loading:

  • It includes a new test to make sure every combination of PNG/TIF, 8/16 bits, Grayscale/RGB/RGBA files are loaded properly.
  • It requires a new set of testing images being integrated in data-testing in PR Add data_test_png_tif dataset data-testing#18.
  • PR Add data_test_png_tif dataset data-testing#18 needs to be approved, merged and a new release of data-testing done to update the link for download here before merging the current PR.
  • I updated some keywords in the code of the test_loader.py file as well.

Linked issues

Fixes #1105

@mariehbourget mariehbourget added the bug category: fixes an error in the code label Mar 17, 2022
Copy link
Member

@dyt811 dyt811 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the concise PR. I will review with the PR18 data and approve it when it passes.

testing/unit_tests/test_loader.py Show resolved Hide resolved
Copy link
Member

@dyt811 dyt811 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking all good. I think just need to update the source ivadomed/scripts/download_data.py for the path to the release and ensuring to use the newer release:

    "data_testing": {
        "url": ["https://github.com/ivadomed/data-testing/archive/r20220221.zip"],
        "description": "Data Used for integration/unit test in Ivadomed."},

@mariehbourget mariehbourget merged commit 165918d into master Mar 28, 2022
@mariehbourget mariehbourget deleted the mhb/1105-fix-tif-16b branch March 28, 2022 20:01
@coveralls
Copy link

Pull Request Test Coverage Report for Build 2054396579

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.06%) to 79.163%

Totals Coverage Status
Change from base Build 2053772380: 0.06%
Covered Lines: 4673
Relevant Lines: 5903

💛 - Coveralls

@dyt811 dyt811 added this to the new release milestone Apr 6, 2022
cakester pushed a commit that referenced this pull request Apr 18, 2022
* segmentation_pair.py: Fix loading of gray TIF files

* test_loader.py: Add test_read_png_tif

* test_loader.py: Add keywords

* Remove unnecessary length_2D and stride_2D in test_read_png_tif

* Update data-testing link in download_data.py
@akraskovSMDB
Copy link

Hi, I think I still have a problem with 16 bit tifs. Is there something wrong with my tif?

I run exactly the same training/testing using the same set of 16 and 8bit images and predictions of the model are wrong for 16 bit images but reasonable for 8 bit images.

I have fresh install of ivadomed
pip show ivadomed
Name: ivadomed
Version: 2.9.8
Here is the link to the images (I can't upload 16 bit tif, it is more than 25 Mb limit)

Happy to share whole BIDS folder and imadomed output folder with the config file

@akraskovSMDB
Copy link

Just checked and I have the same problem with 16 bit PNG images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug category: fixes an error in the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error reading TIF 16bit Grayscale files
4 participants