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

Calculate tumor volume from pixel masks #13

Closed
pjbull opened this Issue Aug 4, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@pjbull
Copy link
Contributor

pjbull commented Aug 4, 2017

Overview

We want to provide clinicians with summary statistics about identified tumors. In the segment model, we output per-pixel binary masks that identify which pixels are likely to be cancer. From these masks, we want to calculate the volume of the tumor.

Expected Behavior

Take as an input the path to the serialized masks (which is the output of the segment predict method). We also have the centroids that are passed into the predict method. For each centroid, calculate the volume of the tumor. DICOM has slice sizes so the units should be in real measurements (not pixels).

Design doc reference:
Jobs to be done > Segment

Technical details

  • This feature should be implemented in the trained_model.py file.
  • The output should be the volume for each tumor (from the centroid list) in a real unit

Related issues

#XX is the work to add this output to the API endpoint.

Acceptance criteria

  • method that outputs volumes from a binary mask and list of centroids
  • tests for this method

NOTE: All PRs must follow the standard PR checklist.

@vessemer

This comment has been minimized.

Copy link
Contributor

vessemer commented Aug 24, 2017

I'm a bit confused: how we are going to calculate the real volume of an area while the function does not receive the CT meta data. Also, can you please clarify how the output from the predict method will be serialised? And last: is it necessary to provide the centroids, since all centroids may be re-estimated via the connected components analysis?

@reubano

This comment has been minimized.

Copy link
Contributor

reubano commented Aug 28, 2017

Hi @vessemer

I'm a bit confused: how we are going to calculate the real volume of an area while the function does not receive the CT meta data.

Good point! I think one way to approach this is to create a new function that outputs metadata, and then pass in that metadata as a third argument. I see you've assumed something similar in your PR via voxel_shape.

Also, can you please clarify how the output from the predict method will be serialised?

That will be up to whoever implements the predict function. I see you have assumed npy files. That should be perfectly fine as a stub for now. In the event a different serialization method is chosen, it shouldn't be too difficult to make the appropriate updates.

And last: is it necessary to provide the centroids, since all centroids may be re-estimated via the connected components analysis?

It is the job of algorithms.identify.trained_model.predict to calculate centroids. And it is this centroids argument that is passed to algorithms.segment.trained_model.predict. segment.trained_model.predict in turn calls segment.trained_model.calculate_volume. While it would be possible for calculate_volume to take dicom_path as an argument, and then calculate centriods on it's own, we prefer to uncouple those steps and have a canonical function dedicated to that task.

@vessemer

This comment has been minimized.

Copy link
Contributor

vessemer commented Aug 29, 2017

@reubano, thanks for making it clear. I guess I've considered all your proposition, by this commit.
Is there something else I need take into account?

@reubano

This comment has been minimized.

Copy link
Contributor

reubano commented Sep 1, 2017

@reubano

This comment has been minimized.

Copy link
Contributor

reubano commented Sep 15, 2017

Closed via #78

@reubano reubano closed this Sep 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment