joint_registration_tumor_segmentation
joint_registration_tumor_segmentation copied to clipboard
moudle error
Hello,
Thanks for your interest to my code.
To launch it, you need to be in the parent folder and launch with python -m
For instance :
cd /home/home_folder/
git clone https://github.com/TheoEst/joint_registration_tumor_segmentation.git
python -m joint_registration_tumor_segmentation.main
您好, 感谢您对我的代码的兴趣。要启动它,您需要在父文件夹中并使用
python -m
例如:
cd /home/home_folder/ git clone https://github.com/TheoEst/joint_registration_tumor_segmentation.git python -m joint_registration_tumor_segmentation.main
I have solved this problem. Unfortunately, I have encountered a new problem. The ". NPY" file is not in the original data. Has your data been preprocessed, and the "-" only brats "on the command line does not seem to be an argument.
Hello, The data is not provided in the GitHub. You need to download both BraTS 2018 and OASIS3 before running the code. You can find the datasets on the following link : https://www.oasis-brains.org/ and https://www.med.upenn.edu/sbia/brats2018/data.html
您好, GitHub中没有提供数据。 在运行代码之前,您需要下载 BraTS 2018 和 OASIS3。 您可以在以下链接中找到数据集:https : //www.oasis-brains.org/和https://www.med.upenn.edu/sbia/brats2018/data.html I have downloaded this original data set from the official website,Unfortunately, the original data does not contain files in ". NPY" format. I want to know whether this is the preprocessed file format or the original one,thank you very much.
During my work, I save all the BraTS dataset into a numpy array. There is no preprocessing, I just load the nii.gz files and save them as .npy. You have two solutions :
- You can change the code to directly load .nii.gz
- Save all the files in .npy as I did.
To export them to .npy, you can use this code :
cohorts = ['HGG', 'LGG']
modalities = ['_flair.nii.gz', '_t1.nii.gz', '_t1ce.nii.gz', '_t2.nii.gz']
for cohort in cohorts:
cohort_path = main_path+ cohort + '/'
patients = [file for file in os.listdir(cohort_path) if
os.path.isdir(cohort_path + file)]
for patient in tqdm(patients):
patient_path = path + patient + '/'
modalities_array = []
for modalitie in modalities:
file = patient_path + patient + modalitie
image = sitk.ReadImage(file)
array = sitk.GetArrayFromImage(image)
modalities_array.append(array)
array = np.stack(modalities_array)
np.save(save_path + '/' + cohort + '/' + patient, array)
During my work, I save all the BraTS dataset into a numpy array. There is no preprocessing, I just load the nii.gz files and save them as .npy. You have two solutions :
- You can change the code to directly load .nii.gz
- Save all the files in .npy as I did.
To export them to .npy, you can use this code :
cohorts = ['HGG', 'LGG'] modalities = ['_flair.nii.gz', '_t1.nii.gz', '_t1ce.nii.gz', '_t2.nii.gz'] for cohort in cohorts: cohort_path = main_path+ cohort + '/' patients = [file for file in os.listdir(cohort_path) if os.path.isdir(cohort_path + file)] for patient in tqdm(patients): patient_path = path + patient + '/' modalities_array = [] for modalitie in modalities: file = patient_path + patient + modalitie image = sitk.ReadImage(file) array = sitk.GetArrayFromImage(image) modalities_array.append(array) array = np.stack(modalities_array) np.save(save_path + '/' + cohort + '/' + patient, array)
Sorry to bother you, I have another problem when I use it The following error occurred while NPY file format.
What did you do ? I don't understand, how the problem occurs
What did you do ? I don't understand, how the problem occurs
This problem happened because I generated it according to your way The NPY file cannot be recognized. I don't know if it is a process error in generating the file.
Normaly, if you do the training with brats file, you should open image with the following line : https://github.com/TheoEst/joint_registration_tumor_segmentation/blob/62b4b25f3c3285a016861e74f3708aca5511f796/Dataset.py#L307
And the function np.load
can load .npy
files without problem.
Normaly, if you do the training with brats file, you should open image with the following line :
https://github.com/TheoEst/joint_registration_tumor_segmentation/blob/62b4b25f3c3285a016861e74f3708aca5511f796/Dataset.py#L307
And the function can load files without problem.
np.load``.npy
I found that my problem was generated There is an error in the NPY file. I want to know whether the code you replied to me needs to be run independently or added to a Py file to run.
You need to put in a py file and run it independently.
您需要放入py文件并独立运行它。 Senior, I think some of the errors may be caused by version problems. Can you provide keras and tensorflow versions of the source code
Dear author, how can I solve this problem?
您需要放入py文件并独立运行它。 Senior, I think some of the errors may be caused by version problems. Can you provide keras and tensorflow versions of the source code
Hi! How did you solve this problem?
您需要放入py文件并独立运行它。 Senior, I think some of the errors may be caused by version problems. Can you provide keras and tensorflow versions of the source code
![]()
![]()
Hi! How did you solve this problem?
I can not solve this problem
您需要放入py文件并独立运行它。 Senior, I think some of the errors may be caused by version problems. Can you provide keras and tensorflow versions of the source code
![]()
![]()
Hi! How did you solve this problem?
I can not solve this problem
do you meet the problem 'DataGenerator' object has no attribute 'only_close_tumor'? Is this a question about the version?
我认为那不是版本问题,应该是代码本身问题吧
------------------ 原始邮件 ------------------ 发件人: "TheoEst/joint_registration_tumor_segmentation" @.>; 发送时间: 2022年6月22日(星期三) 下午4:06 @.>; @.@.>; 主题: Re: [TheoEst/joint_registration_tumor_segmentation] moudle error (Issue #2)
您需要放入py文件并独立运行它。 Senior, I think some of the errors may be caused by version problems. Can you provide keras and tensorflow versions of the source code
Hi! How did you solve this problem?
I can not solve this problem
do you meet the problem 'DataGenerator' object has no attribute 'only_close_tumor'? Is this a question about the version?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
我认为那不是版本问题,应该是代码本身问题吧 … ------------------ 原始邮件 ------------------ 发件人: "TheoEst/joint_registration_tumor_segmentation" @.>; 发送时间: 2022年6月22日(星期三) 下午4:06 @.>; @.@.>; 主题: Re: [TheoEst/joint_registration_tumor_segmentation] moudle error (Issue #2) 您需要放入py文件并独立运行它。 Senior, I think some of the errors may be caused by version problems. Can you provide keras and tensorflow versions of the source code Hi! How did you solve this problem? I can not solve this problem do you meet the problem 'DataGenerator' object has no attribute 'only_close_tumor'? Is this a question about the version? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
我现在在做配准分割这类的一些东西,能加你个联系方式吗?qq vx啥的
Hello, Indeed there is a problem in the code. I will correct it soon best regards
Hello, Indeed there is a problem in the code. I will correct it soon best regards
thank you
Hello, Indeed there is a problem in the code. I will correct it soon best regards
thank you very much
Fix in 2cefdeb1e00c8516bb1382697dd11ccb73cdbdb1
Fix in 2cefdeb
![]()
Dear author, how should I use l2 loss here?