angelolab / Nimbus

Other
12 stars 1 forks source link

Add nuclei, membrane channel and tissue type attribute to tfrecord dataset generation #46

Closed JLrumberger closed 1 year ago

JLrumberger commented 1 year ago

What is the purpose of this PR?

This PR closes #43. It adds a nuclei and a membrane channel as well as the tissue type to the training examples stored in the tfrecord. Nuclei and membrane channels are calculated as the average of the normalized channels whose names are passed to the init.

How did you implement your changes

Class SegmentationTFRecords gets three additional inputs: nuclei_channels, membrane_channels and tissue_type. The latter is just directly stored as a string attribute in the tfrecord examples. The former two contain lists of channel names (like ["Ki67", "Dapi"]) and the channels are loaded with the new class function SegmentationTFRecords.get_composite_image. The function loads and normalizes the images and returns the average over the channel dimension.

Remaining issues None