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

Class for labeled images #47

Open
CsatiZoltan opened this issue Dec 4, 2020 · 0 comments
Open

Class for labeled images #47

CsatiZoltan opened this issue Dec 4, 2020 · 0 comments
Assignees
Labels
API Changes in function signatures
Milestone

Comments

@CsatiZoltan
Copy link
Owner

More and more functions work on labeled images in the codebase. Currently, these are

  • show_label_image
  • label_image_skeleton
  • thicken_skeleton
  • label_image_apply_mask
  • some methods of the Analysis class could also come here

in the analysis module and

  • Segmentation.save_image
  • Segmentation.save_array

in the segmentation module.


It is time to collect them in a class. We will call this class LabeledImage1 and it should have, at first thought, the following methods:

  • __init__(self, label_image)
  • find_skeleton
  • thicken_skeleton
  • apply_mask(self, mask, value)
  • change_label(self, old_labels, new_labels)
  • show(self, color='random', labels=False) 2
  • save_png(self, filename)
  • save_numpy(self, filename)
  • _validate(label_image)
  • __str__(self)

and with the following data members:

  • n_label

Once the class has been created, deprecate the old functions and also mention this class creation principal as an example under the "Do not overuse classes" bullet point of the program design.


1 MATLAB calls it "label image". However, the word "label" is also a verb and we want to avoid the misunderstanding that we perform labeling as done in computer vision. We also prefer "labeled" to "labelled" as American English is used in the rest of CristalX.
2 Other values for the color parameter:

@CsatiZoltan CsatiZoltan added the API Changes in function signatures label Dec 4, 2020
@CsatiZoltan CsatiZoltan added this to the v1.2.0 milestone Dec 4, 2020
@CsatiZoltan CsatiZoltan self-assigned this Dec 4, 2020
@CsatiZoltan CsatiZoltan modified the milestones: v1.2.0, v1.3.0 Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes in function signatures
Projects
None yet
Development

No branches or pull requests

1 participant