Closed Gresliebear closed 3 years ago
no source code is public, please feel welcomed to read the manual.
can you please specify what you are trying to do and how?
ya, I found the link at the bottom, my bad. Anyways I am trying to do preprocessing on the 2020 Brats dataset because I want to try attempting the challenge for 2021 this year. I am running the Brats toolkit on windows 10 but I have read in all the data so I build a for loop to process it all at once.
import os
import pandas as pd
from brats_toolkit.preprocessor import Preprocessor
# instantiate
prep = Preprocessor()
## convert mapping info
## survial
name_mapping = r"E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData\name_mapping.csv"
survival_info = r"E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData\survival_info.csv"
df_name_mapping = pd.read_csv(name_mapping)
df_survival_info = pd.read_csv(survival_info)
root_path_train = r"E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData"
outputDir = r"E:\Datasets\BraTS challenge\Output\Output_training"
list_of_dir = os.listdir(root_path_train)
for name_of_file in list_of_dir:
#if name_of_file contains .csv it skips iteration on the loop
if name_of_file.endswith('.csv'):
continue
#We make new path tto list to for loop through we list that dir
readable_path = os.path.join(root_path_train , name_of_file)
list_of_zips = os.listdir(readable_path)
# we for loop each folder
list_sort = []
outpath = os.path.join(outputDir, name_of_file)
for zips in list_of_zips:
readable_path_2nd = os.path.join(readable_path, zips)
list_sort.append(readable_path_2nd)
list_sort = sorted(list_sort)
## missing var for segmentation preprocessing # E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData\BraTS20_Training_369\BraTS20_Training_369_seg.nii.gz 2 ??
examName = name_of_file
flaFile = list_sort[0] # E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData\BraTS20_Training_369\BraTS20_Training_369_flair.nii.gz1 flaFile
t1File = list_sort[2] # E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData\BraTS20_Training_369\BraTS20_Training_369_t1.nii.gz 3 t1File
t1cFile = list_sort[3] # E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData\BraTS20_Training_369\BraTS20_Training_369_t1ce.nii.gz 4 t1cFile
t2File = list_sort[4] # E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData\BraTS20_Training_369\BraTS20_Training_369_t2.nii.gz 5 t2File
## this code calls docker!
##dcm2niix conversion
prep.single_preprocess(t1File=t1File,
t1cFile=t1cFile,
t2File=t2File,
flaFile=flaFile,
outputFolder=outputDir,
mode="cpu",
confirm=True,
skipUpdate=False,
gpuid='0')
so your preprocessing object from your tool kit is called at bottom to process each patient file basically. I notice it calls a docker object pull but I really don't know whats wrong with the code at this point I need to more reading into source code or check the variables I am passing to your object.
Hmm the Brats 2020 data is already preprocessed and skullstripped? There is no need to do it again? Can you elaborate please?
On Fri, 9 Jul 2021, 21:47 Leslie Wubbel, @.***> wrote:
ya, I found the link at the bottom, my bad. Anyways I am trying to do preprocessing on the 2020 Brats dataset because I want to try attempting the challenge for 2021 this year. I am running the Brats toolkit on windows 10 but I have read in all the data so I build a for loop to process it all at once.
import os import pandas as pd from brats_toolkit.preprocessor import Preprocessor
instantiate
prep = Preprocessor()
convert mapping info
survial
name_mapping = r"E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData\name_mapping.csv" survival_info = r"E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData\survival_info.csv"
df_name_mapping = pd.read_csv(name_mapping) df_survival_info = pd.read_csv(survival_info)
root_path_train = r"E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData" outputDir = r"E:\Datasets\BraTS challenge\Output\Output_training" list_of_dir = os.listdir(root_path_train)
for name_of_file in list_of_dir:
#if name_of_file contains .csv it skips iteration on the loop if name_of_file.endswith('.csv'): continue #We make new path tto list to for loop through we list that dir readable_path = os.path.join(root_path_train , name_of_file) list_of_zips = os.listdir(readable_path) # we for loop each folder list_sort = [] outpath = os.path.join(outputDir, name_of_file) for zips in list_of_zips: readable_path_2nd = os.path.join(readable_path, zips) list_sort.append(readable_path_2nd) list_sort = sorted(list_sort) ## missing var for segmentation preprocessing # E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData\BraTS20_Training_369\BraTS20_Training_369_seg.nii.gz 2 ?? examName = name_of_file flaFile = list_sort[0] # E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData\BraTS20_Training_369\BraTS20_Training_369_flair.nii.gz1 flaFile t1File = list_sort[2] # E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData\BraTS20_Training_369\BraTS20_Training_369_t1.nii.gz 3 t1File t1cFile = list_sort[3] # E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData\BraTS20_Training_369\BraTS20_Training_369_t1ce.nii.gz 4 t1cFile t2File = list_sort[4] # E:\Datasets\BraTS challenge\MICCAI_BraTS2020_TrainingData\BraTS20_Training_369\BraTS20_Training_369_t2.nii.gz 5 t2File ## this code calls docker! ##dcm2niix conversion prep.single_preprocess(t1File=t1File, t1cFile=t1cFile, t2File=t2File, flaFile=flaFile, outputFolder=outputDir, mode="cpu", confirm=True, skipUpdate=False, gpuid='0')
so your preprocessing object from your tool kit is called at bottom to process each patient file basically. I notice it calls a docker object pull but I really don't know whats wrong with the code at this point I need to more reading into source code or check the variables I am passing to your object.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/neuronflow/BraTS-Toolkit/issues/13#issuecomment-877418233, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVY46SV5UYKVESLI3KF45TTW5G3NANCNFSM477LIDHQ .
like preprocessing data for a model like a deep learning model, you need to preprocess your data sometimes its for pngs, nitfti files, but are you saying that this specific toolkit was used to create the dataset?
No the Brats 2020 data was mostly created by a pipeline from UPenn with a slightly different skullstripper but the outputs are almost identical. We might have a future update incorporating the UPenn pipeline. I encourage you to read the btk paper to develop a better understanding of the three btk modules.
On Fri, 9 Jul 2021, 21:53 Leslie Wubbel, @.***> wrote:
like preprocessing data for a model like a deep learning model, you need to preprocess your data sometimes its for pngs, nitfti files, but are you saying that this specific toolkit was used to create the dataset?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/neuronflow/BraTS-Toolkit/issues/13#issuecomment-877421474, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVY46X725WLBSNVIB6UKFTTW5HUHANCNFSM477LIDHQ .
ok so your saying that the dataset doesn't need any type of preprocessing? that the BraTS toolkit doesn't already provides? I will do more reading but btk modules? btk papers, I am sorry what resources are you talking about I haven't found these yet.
I will write my own preprocessing methods for our model but I am not trying to reinvent the wheel or deviate from common methods agreed upon by research, does that make sense?
https://github.com/neuronflow/BraTS-Toolkit#citation
Btk preprocessor can help you to preprocess Mr data so it can be segmented using BraTS algorithms.
On Fri, 9 Jul 2021, 22:02 Leslie Wubbel, @.***> wrote:
ok so your saying that the dataset doesn't need any type of preprocessing? that the BraTS toolkit doesn't already provides? I will do more reading but btk modules? btk papers, I am sorry what resources are you talking about I haven't found these yet.
I will write my own preprocessing methods for our model but I am not trying to reinvent the wheel or deviate from common methods agreed upon by research, does that make sense?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/neuronflow/BraTS-Toolkit/issues/13#issuecomment-877425735, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVY46XJJA2QL6PNIDIVJR3TW5IVJANCNFSM477LIDHQ .
ok I guess that makes sense? still confused I will continue trying anyways, Thank you for the help.
Is the source code private?
I am trying to use on Windows 10 got error