question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Patches truncated for 16 bit images

See original GitHub issue

Likely due to this line: https://github.com/neuropoly/axondeepseg/blob/57047da51781c12d06c1b5d59dcb705bf4adc376/AxonDeepSeg/data_management/dataset_building.py#L44

Combining preserve_range plus asint may be what’s truncating the patches (all white).

capture d ecran 2019-02-22 a 14 17 54

The solution may be as simple as removing the asint call.

@maxwab you wrote that line; do you see any issues with removing the asint call? I’ll double check the rest of the code to make sure it’s not assumed to be an 8bit int anywhere else. I guess it means that if I remove this, the data size will be much larger… Otherwise, removing the perserve_range could also possibly be a solution.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
maxwabcommented, Feb 22, 2019

Hi @mathieuboudreau, At first glance I don’t see any problem with removing the .astype(int) call. The most likely reason I added this call at the time was to ensure the type of img. As far as I can tell, the reason was not memory usage.

0reactions
mathieuboudreaucommented, Feb 22, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug] Patches truncated for 16 bit images · Issue #166 - GitHub
Poking around, although I was able to find where the images are converted toint patches in the dataset building stage, but in the...
Read more >
Large images may cause "Image corrupt or truncated" error
Examples of appropriate bugs: PNG gAMA chunk ignored; Crashes on GIF w/corrupted frame(merr-01.gif); or PNGs and JPEGs aren't displayed on FreeBSD.
Read more >
Google patches actively exploited zero-day bug that affects Chrome ...
1) Obtains the image width and height from the header as 32-bit integers. 2) Truncates the obtained values to 16 bit and stores...
Read more >
Bug 645938 – image exported to .png is truncated
I tested with 16M rows, 1000 pixels high each, and I did not see any resolution loss. I did not read all cairo...
Read more >
macOS Image Capture Bug More Pervasive Than Originally ...
Earlier this week we reported on a bug in Apple's macOS Image Capture app that adds empty data to photos when imported from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found