chanzuckerberg / cryoet-data-portal-backend

CryoET Data Portal API server & ingestion scripts
MIT License
1 stars 2 forks source link

fix: Segmentation mask output datatype to int #170

Closed manasaV3 closed 1 month ago

manasaV3 commented 1 month ago

Relates to

Description

Fixes the issue of segmentation mask output being a float. The converter selection is determined by if the label is None.

jgadling commented 1 month ago

Note: at some point a test would be nice

manasaV3 commented 1 month ago

Note: at some point a test would be nice

I agree. I think in addition to this being unit test, this is something we should add to our s3 validation. cc: @daniel-ji

uermel commented 1 month ago

Found the bug:

TomoConverter.scaled_data_transformation also has to be applied to the base layer of the pyramid here: https://github.com/chanzuckerberg/cryoet-data-portal-backend/blob/66e0ddc0cffdafe8b0d71d678b7443a585337ca2/ingestion_tools/scripts/common/image.py#L273

i.e. change to

pyramid = [self.scaled_data_transformation(self.volume_reader.get_pyramid_base_data())]

We actually had mixed precision pyramids.