NIfTI-Image-Converter icon indicating copy to clipboard operation
NIfTI-Image-Converter copied to clipboard

NIFTI images (MRI, DTI, and PET) from ADNI database to jpg

Open dupfem opened this issue 2 years ago • 1 comments

I have the dataset with four classes . I want to convert the NIFTI images to jpg to develop a model for classification

I am still debugging this segments of the code: base_path=os.path.abspath(os.path.dirname(file)) parser = argparse.ArgumentParser(description='Arguments for input and output files') parser.add_argument('--input_path', type=str, default = base_path, help='Path of the input files') parser.add_argument('--rotation_angle', type=int, default = 90, help='Rotation degree, i.e., 90°, 180°, 270°, default value is 90°') args = parser.parse_args() input_path = args.input_path rotation_angle = args.rotation_angle ############################################################## #get list of nii or nii.gz source files source_files = os.listdir(input_path) slice_counter = 0 #identify sample ids and get source ids source_ids = [files[0:8] for files in source_files if files.endswith('.nii')]

sample_ids = list(set(source_ids))

dupfem avatar Nov 07 '22 16:11 dupfem