def dicom_to_nifti(dicom_input, output_file=None): """ This is the main dicom to nifti conversion fuction for hitachi images. As input hitachi images are required. It will then determine the type of images and do the correct conversion Examples: See unit test :param output_file: file path to the output nifti :param dicom_input: directory with dicom files for 1 scan """ assert common.is_hitachi(dicom_input) # remove duplicate slices based on position and data dicom_input = convert_generic.remove_duplicate_slices(dicom_input) # remove localizers based on image type dicom_input = convert_generic.remove_localizers_by_imagetype(dicom_input) # remove_localizers based on image orientation (only valid if slicecount is validated) dicom_input = convert_generic.remove_localizers_by_orientation(dicom_input) # TODO add validations and conversion for DTI and fMRI once testdata is available logger.info('Assuming anatomical data') return convert_generic.dicom_to_nifti(dicom_input, output_file)
def dicom_to_nifti(dicom_input, output_file=None): """ This is the main dicom to nifti conversion fuction for hitachi images. As input hitachi images are required. It will then determine the type of images and do the correct conversion Examples: See unit test :param output_file: file path to the output nifti :param dicom_input: directory with dicom files for 1 scan """ assert common.is_hitachi(dicom_input) # TODO add validations and conversion for DTI and fMRI once testdata is available logger.info('Assuming anatomical data') return convert_generic.dicom_to_nifti(dicom_input, output_file)
def _get_vendor(dicom_input): """ This function will check the dicom headers to see which type of series it is Possibilities are fMRI, DTI, Anatomical (if no clear type is found anatomical is used) """ # check if it is siemens if common.is_siemens(dicom_input): logger.info('Found manufacturer: SIEMENS') return Vendor.SIEMENS # check if it is ge if common.is_ge(dicom_input): logger.info('Found manufacturer: GE') return Vendor.GE # check if it is philips if common.is_philips(dicom_input): logger.info('Found manufacturer: PHILIPS') return Vendor.PHILIPS # check if it is philips if common.is_hitachi(dicom_input): logger.info('Found manufacturer: HITACHI') return Vendor.HITACHI # generic by default logger.info('WARNING: Assuming generic vendor conversion (ANATOMICAL)') return Vendor.GENERIC
def _get_vendor(dicom_input): """ This function will check the dicom headers to see which type of series it is Possibilities are fMRI, DTI, Anatomical (if no clear type is found anatomical is used) """ # check if it is siemens if common.is_siemens(dicom_input): logger.info('Found manufacturer: SIEMENS') return Vendor.SIEMENS # check if it is ge if common.is_ge(dicom_input): logger.info('Found manufacturer: GE') return Vendor.GE # check if it is philips if common.is_philips(dicom_input): logger.info('Found manufacturer: PHILIPS') return Vendor.PHILIPS # check if it is philips if common.is_hitachi(dicom_input): logger.info('Found manufacturer: HITACHI') return Vendor.HITACHI # generic by default logger.info('WARNING: Assuming generic vendor conversion (ANATOMICAL)') return Vendor.GENERIC