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

feature: save labeled segmentations rather than binary segmentations #193

Draft
wants to merge 31 commits into
base: jghrefactor/A2f-add-single-file-versions-of-cli-hdf5files
Choose a base branch
from

Conversation

hollandjg
Copy link
Collaborator

@hollandjg hollandjg commented Nov 6, 2024

Changes:

  • Update floe segmentation to save a labeled image rather than a BitMatrix (for the single file version).
  • Add label to properties collected (for the single file version)

ToDo:

  • Define and test some functions to save and load the labeled image – ensure that what gets saved is the same as what gets loaded.
  • Decide whether to update types so that the label just has to be a smaller integer datatype than the labeled image.
  • Test that this works the same as the old implementation

Copy link
Member

Choose a reason for hiding this comment

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

Are you intending to use a Makefile or something to orchestrate the initialization? What's the plan?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nope, this is just a simple test script which will receive the IFT CLI's command via an environment variable and allow you to get a check on whether it ran through or failed. The cylc workflow tests will be separate. There will be no makefile.

The tests of correctness of functionality should be in the Julia package.

Copy link
Collaborator

@danielmwatkins danielmwatkins left a comment

Choose a reason for hiding this comment

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

Looks good to me! (Pending the changes passing the tests of course)

Comment on lines +92 to +102
imgs_ = [load_labeled_img(img) for img in imgs]
@info "Loading $props"
props_ = [DataFrame(CSV.File(prop)) for prop in props]
# go through each of the props_ dataframes and convert each
# into the element type from the corresponding image.
for (img_, prop_) in zip(imgs_, props_)
label_type = eltype(img_)
@debug "converting labels to $label_type"
prop_[!,:label] = convert.(label_type, prop_[!,:label])
end
Copy link
Member

@cpaniaguam cpaniaguam Nov 26, 2024

Choose a reason for hiding this comment

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

This suggests you might not be using a formatter. We've been using blue for Julia files.

# .JuliaFormatter.toml
style = "blue"
indent = 4

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've added this to #197

uncasted_image = convert_uint_from_gray(casted_image)

@test isequal(image, uncasted_image)
@test isequal(eltype(image), eltype(uncasted_image))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@test isequal(eltype(image), eltype(uncasted_image))
@test isequal(T, eltype(uncasted_image))

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think that change helps the reader understand the meaning of the test. The test as it is right now says "the eltypes of the images should be the same" whereas you're suggesting something which I'd read as "the eltype of the uncasted image should be the same as the element type of the argument to the function we're in" – which although being essentially the same thing, makes you have to think one level more abstractly when parsing the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants