rtCommon.checkDicomNiftiConversion


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.


Module Contents

Functions

checkingDicomNiftiConversion(cfg)

Purpose: check the nibabel nifti/dicom conversion method BEFORE using it in

main()

rtCommon.checkDicomNiftiConversion.checkingDicomNiftiConversion(cfg)

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.

STEPS:
  1. set up config

  2. get number of TRs from dicom path and nifti path

  3. go through each TR in dicom, convert them each to niftis and save

  4. load in each nifti into new data matrix

  5. compare this to loaded offline nifti file

rtCommon.checkDicomNiftiConversion.main()