KidsWithTokens / MedSegDiff

Medical Image Segmentation with Diffusion Model
MIT License
979 stars 147 forks source link

There is a wrong in data_csv index #86

Closed sunshinelike closed 1 year ago

sunshinelike commented 1 year ago
ad5efb19ff1c5d00bfe1b3d83ebd9fe 968c0a90eecef9b35134c2569322c50
WuJunde commented 1 year ago

yes. sorry for leading the misunderstanding. the difference between part1 and 3b is that part1 is only for segmentation, and 3b is for segmentation and diagnosis. I switch it from 3b to 1 in version 2, but both will work fine. you can download part1 data and use this csv anyway.

sunshinelike commented 1 year ago

OK, thank you very much, got, if you could update the readme and file name, that would be better for understanding. And could you share the csv maker script?

WuJunde commented 1 year ago

sure

`import os import pandas as pd

path = '../../data/isic/isic2016' train_data_dir = 'ISBI2016_ISIC_Part1_Training_Data' train_gt_dir = 'ISBI2016_ISIC_Part1_Training_GroundTruth' csv_path_train = '../ISBI2016_ISIC_Part3B_Training_GroundTruth.csv'

col_names = ['img','seg'] df = pd.DataFrame()

for (root,dirs,files) in os.walk(os.path.join(path,train_data_dir), topdown=True): for name in files: preind = name.split('.')[0] segname = preind + '_Segmentation.png' segpath = os.path.join( train_gt_dir, segname) imgpath = os.path.join( train_data_dir, name) data = pd.DataFrame([[imgpath,segpath]], columns = col_names) df = df.append(data, ignore_index=True) df.to_csv(csv_path_train)`

sunshinelike commented 1 year ago

Thank you very much. But when I download part1 data, it has no corresponding segmentation image, the index is also wrong. If I use your script

sure

`import os import pandas as pd

path = '../../data/isic/isic2016' train_data_dir = 'ISBI2016_ISIC_Part1_Training_Data' train_gt_dir = 'ISBI2016_ISIC_Part1_Training_GroundTruth' csv_path_train = '../ISBI2016_ISIC_Part3B_Training_GroundTruth.csv'

col_names = ['img','seg'] df = pd.DataFrame()

for (root,dirs,files) in os.walk(os.path.join(path,train_data_dir), topdown=True): for name in files: preind = name.split('.')[0] segname = preind + '_Segmentation.png' segpath = os.path.join( train_gt_dir, segname) imgpath = os.path.join( train_data_dir, name) data = pd.DataFrame([[imgpath,segpath]], columns = col_names) df = df.append(data, ignore_index=True) df.to_csv(csv_path_train)`

WuJunde commented 1 year ago

download training ground truth, which is the segmentation

sunshinelike commented 1 year ago

download training ground truth, which is the segmentation Oh, I see. Thank you very much, best wishes.