Closed athenahowell closed 8 months ago
Hi @athenahowell,
Based on the error message, it sounds like it is expecting your dataframe to have a column explicitly called PATH
. Please rename your column name in your CSV to PATH
(case-sensitive) and try again.
Best, Steven
That is true. You must have a column named "PATH" in your data frame. See help documentation for function createMaskNIFTI
.
Hi,
I'm trying to use neuroHarmonize for a group of NIFTI images. I've created a csv file with all the full paths to the images, and then I've copied & pasted your instructions, but "nifti_avg, nifti_mask, affine, hdr0 = createMaskNIFTI(nifti_list, threshold=0)" fails with this error:
"Traceback (most recent call last): File "", line 1, in
File "/fs/ess/PCON0381/.conda/envs/neuroHarmonize/lib/python3.11/site-packages/neuroHarmonize/harmonizationNIFTI.py", line 44, in createMaskNIFTI
nifti_i = nib.load(paths.PATH[i])
^^^^^^^^^^
File "/fs/ess/PCON0381/.conda/envs/neuroHarmonize/lib/python3.11/site-packages/pandas/core/generic.py", line 5902, in getattr
return object.getattribute(self, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'DataFrame' object has no attribute 'PATH'
"
I'm fairly new to python, so I'm not sure how to debug this. This is how my csv with the brain paths is structured:
fullpath /fs/ess/PCON0381/DIAMOND_Athena/ToHarmonize/Con15_2Evs2No_nii/diamond_20141217.10025_con_0015.nii.gz /fs/ess/PCON0381/DIAMOND_Athena/ToHarmonize/Con15_2Evs2No_nii/diamond_20150109.10032_con_0015.nii.gz /fs/ess/PCON0381/DIAMOND_Athena/ToHarmonize/Con15_2Evs2No_nii/diamond_20150112.10033_con_0015.nii.gz /fs/ess/PCON0381/DIAMOND_Athena/ToHarmonize/Con15_2Evs2No_nii/diamond_20150205.10039_con_0015.nii.gz /fs/ess/PCON0381/DIAMOND_Athena/ToHarmonize/Con15_2Evs2No_nii/diamond_20150212.10035_con_0015.nii.gz /fs/ess/PCON0381/DIAMOND_Athena/ToHarmonize/Con15_2Evs2No_nii/diamond_20150213.10034_con_0015.nii.gz ...