Fix bugs in read and write functions about strokeColor, fillColor, and position#23
Open
gaole2019 wants to merge 2 commits intodavidcsterratt:masterfrom
Open
Fix bugs in read and write functions about strokeColor, fillColor, and position#23gaole2019 wants to merge 2 commits intodavidcsterratt:masterfrom
gaole2019 wants to merge 2 commits intodavidcsterratt:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, David,
Recently, I dealt with roi files in a stack image and found some bugs in the source code.
strokeColor and fillColor are encoded as 32 bit unsigned integer (A, R, G, B) in ImageJ. However, in R, 32 bit integer can only be written in singned mode, which causes error in encoding and decoding the color. To overcome this problem, I chose to encode and decode strokeColor and fillColor using four bytes, parsing alpha, red, green, and blue channels, respectively.
"position" is an important property when I dealt with a stack image, which indicates the index of slices of the roi. It is encoded as 32 bit unsigned integer with big-endian in ImageJ. But, now we used "little-endian", which gets the wrong value.
I also uploaded a demo_stack and roi file on slice 42 (https://drive.google.com/drive/folders/1ouCkL7eY-JnYYG49JAdCmoWEIJ7s1_qO?usp=drive_link). You can double check it.
Best regards
Le