checkDicomNiftiConversion.py (Last Updated: 05/26/2020)
The purpose of this script is to check that the nifti file conversion done during real-time in the cloud matches the nifti conversion done during your offline analyses, assuming you used heudiconv or you directly called ‘dcm2nix()’. This script addresses the warning you get when you import pydicom.
To run this script, uncomment the lines in ‘def main()’ below. Complete the sections that need to be filled in, denoted by “[FILL IN]”’”. Save this file and then run the script “python checkDicomNiftiConversion.py” in the terminal.
Purpose: check the nibabel nifti/dicom conversion method BEFORE using it in
Purpose: check the nibabel nifti/dicom conversion method BEFORE using it in real-time. Here we’re assuming you have raw dicoms and the corresponding converted nifti that you used in pilot data collection.
set up config
get number of TRs from dicom path and nifti path
go through each TR in dicom, convert them each to niftis and save
load in each nifti into new data matrix
compare this to loaded offline nifti file