atlan-antillia / CAMUS_public-ImageMask-Dataset

CAMUS_public ImageMask Dataset for Segmentatioin
Apache License 2.0
2 stars 0 forks source link

About classification #2

Open Yaostars opened 6 days ago

Yaostars commented 6 days ago

Hello, I tried your method and succesfully got the images. I now confused about how many classfications do the dataset have? Are there four classfications?

atlan-antillia commented 6 days ago

Hi.

Please go to the following web site:

https://humanheart-project.creatis.insa-lyon.fr/database/#item/64b5abe573e9f00492ce9061 and download script_camus_ef.ipynb from the following link https://humanheart-project.creatis.insa-lyon.fr/database/api/v1/file/64b5abe573e9f00492ce9062/download

You can see the following code in the the ipynb, which helps to get multi-class segmentation masks.

###########################################

PARAMETERS TO PLAY WITH

database_nifti_root = Path("../database_nifti") lv_label = 1

Select the patient identification (scalar value between 1 and 500)

patient_id = 1

#

Specify the ID and path of the patient to be loaded

patient_name = f"patient{patient_id:04d}" patient_dir = database_nifti_root / patient_name gt_mask_pattern = "{patientname}{view}_{instant}_gt.nii.gz" print(f"Loading data from patient folder: {patient_dir}")

view = "2CH" instant = "ED" a2c_ed, a2c_info = sitk_load(patient_dir / gt_mask_pattern.format(patient_name=patient_name, view=view, instant=instant)) a2c_voxelspacing = a2c_info["spacing"][:2][::-1] # Extract the (width,height) dimension from the metadata and order them like in the mask

instant = "ES" a2ces, = sitk_load(patient_dir / gt_mask_pattern.format(patient_name=patient_name, view=view, instant=instant))

view = "4CH" instant = "ED" a4c_ed, a4c_info = sitk_load(patient_dir / gt_mask_pattern.format(patient_name=patient_name, view=view, instant=instant)) a4c_voxelspacing = a4c_info["spacing"][:2][::-1] # Extract the (width,height) dimension from the metadata and order them like in the mask

instant = "ES" a4ces, = sitk_load(patient_dir / gt_mask_pattern.format(patient_name=patient_name, view=view, instant=instant))

# Extract binary LV masks from the multi-class segmentation masksa2c_ed_lv_mask = a2c_ed == lv_labela2c_es_lv_mask = a2c_es == lv_labela4c_ed_lv_mask = a4c_ed == lv_labela4c_es_lv_mask = a4c_es == lv_label

Use the provided implementation to compute the LV volumes

edv, esv = compute_left_ventricle_volumes(a2c_ed_lv_mask, a2c_es_lv_mask, a2c_voxelspacing, a4c_ed_lv_mask, a4c_es_lv_mask, a4c_voxelspacing) ef = round(100 * (edv - esv) / edv) # Round the computed value to the nearest integer

print(f"{patient_name=}: {ef=}, {edv=}, {esv=}")

2024年9月30日(月) 21:35 Xincheng Yao @.***>:

Hello, I tried your method and succesfully got the images. I now confused about how many classfications do the dataset have? Are there four classfications?

— Reply to this email directly, view it on GitHub https://github.com/atlan-antillia/CAMUS_public-ImageMask-Dataset/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALPI2IIOI2IWTH2Q7AMIZJLZZFAP3AVCNFSM6AAAAABPDF77OSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU2TMNJSGI2TCMQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>