Open
Description
It is great to find that SPM has a python version!
I am trying to move previous scripts from Matlab to python. But I not sure the api and how to use it in the python. For example, in Matlab, I can read dicom in the following script:
spm('defaults','fmri');
spm_jobman('initcfg');
matlabbatch{1}.spm.util.import.dicom.data = spm_input_dir(input);
matlabbatch{1}.spm.util.import.dicom.root = 'flat';
matlabbatch{1}.spm.util.import.dicom.outdir = {output};
matlabbatch{1}.spm.util.import.dicom.protfilter = '.*';
matlabbatch{1}.spm.util.import.dicom.convopts.format = 'nii';
matlabbatch{1}.spm.util.import.dicom.convopts.meta = 0;
matlabbatch{1}.spm.util.import.dicom.convopts.icedims = 0;
spm_jobman('run',matlabbatch);
But I am not sure which function to call and which parameters to pass in python. It will be great if you can give more examples, such as how to import dicom, registration and segmentations and so on.
Thank you !