jlevy44 / PathFlowAI

A High-Throughput Workflow for Preprocessing, Deep Learning Analytics and Interpretation in Digital Pathology
https://jlevy44.github.io/PathFlowAI/
MIT License
39 stars 8 forks source link

Generating .npy input format for segmentation with a multi-channel tif #22

Closed asmagen closed 4 years ago

asmagen commented 4 years ago

I collected some example data to start working with PFAI, but I need to find a workaround the input formatting. I have a set of tif files where each file has 6 channels corresponding to (1) background (2) tumor (3) normal (4) stroma etc. The libraries I typically use like CV2 and similar counterparts handle only three channels, and the resources I found online seem to discuss only saving 4+ channel files rather than reading and converting. Do you know can I convert my input files to the requested npy format for PFAI segmentation?

Thanks

jlevy44 commented 4 years ago

I would try tifffile's imread, then write to numpy with np.save .