ashleylk / CODA

version 1 scripts for CODA
34 stars 9 forks source link

Run error #2

Closed ann1988425 closed 2 months ago

ann1988425 commented 4 months ago

Hello, are your results trained using the 5 training sets and a test set provided by the sample annotations in your CODA sample dataset? Why does an infinite loop appear at this step when I use this training method? 200bea7d2fb2a84dd9d3055a12ce4be

ashleylk commented 4 months ago

Hello, this step to build image pairs for model training can take a few hours depending on the specs of your computer. Is the software outputting training tiles? Try checking in the folder "pthDL", then a subfolder 'training\big_tiles\'. If that subfolder contains jpg files, the code is still running to build training and validation images.

ann1988425 commented 4 months ago

Thank you for your kind reply, I have made that step and sucessfully trained my model. But I come up with a new problem when running test_model_performance (line 134 in train_image_segmentation_lung.m). The bug shows like:

1fd8f9252ea585c4b5ad79b240f4c17

And I trace back found that the tiff files in both train and test label file are all black, maybe that's the reason? fbdc95908d097e88dad8113f99390c6

khl0798 commented 3 months ago

@ashleylk @ann1988425 ,Hi dear all,I want to know how you train the model,I followed the steps(https://labs.pathology.jhu.edu/kiemen/wp-content/uploads/sites/39/2023/12/Instructions-for-applying-CODA.pdf ,download data from https://drive.google.com/drive/folders/1K-wY_ArVGbEhebQD4AjOeERwx6-4Fw3G), but the generated TIF file cannot be opened in ImageScope. I have downloaded the latest version of ImageScope. just like this:

ceb03ca439210387cd4880471a93815

Then, the TIF file generated by downsampling with OpenSlide also encountered issues when annotating cell types. `import openslide from PIL import Image import numpy as np

slide = openslide.OpenSlide('lungs_001-.ndpi')

target_mpp = 1.0 #

current_mpp_x = float(slide.properties[openslide.PROPERTY_NAME_MPP_X]) current_mpp_y = float(slide.properties[openslide.PROPERTY_NAME_MPP_Y])

scale_factor_x = current_mpp_x / target_mpp scale_factor_y = current_mpp_y / target_mpp

level = slide.get_best_level_for_downsample(scale_factor_x) downsample = slide.level_downsamples[level]

# region = slide.read_region((0, 0), level, slide.level_dimensions[level])

region_rgb = region.convert("RGB")

region_np = np.array(region_rgb)

width, height = region.size scaled_width = int(width scale_factor_x) scaled_height = int(height scale_factor_y)

scaled_image = Image.fromarray(region_np).resize((scaled_width, scaled_height), Image.LANCZOS)

scaled_image.save('output_file.tiff', format='TIFF')

slide.close() ` just like this:

b9953f3131bed9854d8bca986008d47

Could you please guide me on the steps for annotating cell types and training the model? Thank you very much.

kubota119236541 commented 2 months ago

@ashleylk @ann1988425 I also tried using the sample lung data provided by @ashleylk with CODA, but I encountered the same error as @ann1988425 and cannot proceed further.

If either of you knows a solution, could you please let me know?

run error

ashleylk commented 2 months ago

Dear all,

Apologies for the error. The bug was that the testing image did not contain any annotations of metastases. There must be at least one annotation of each tissue layer in the testing dataset. I've updated the xml file for the testing image and re-uploaded it to the google drive. You may find the new file here: https://drive.google.com/drive/folders/1ztFE8Cv7U-DBEUaBmA2YcNjB8Ru-XbyK?usp=sharing

kubota119236541 commented 2 months ago

@ashleylk

Thank you very much. I will try again with the new file.

I would also like to make 3D reconstruction similar to the supplementary video in your paper. Is it possible to create this using CODA? I have been following the "Instructions for applying CODA" that you provided, but does it include instructions for 3D reconstruction?

SynaSpike commented 1 month ago

@kubota119236541 Did you manage to build their lung dataset model ?