Skip to content

examples and api documents #19

Open
Open
@pcasl

Description

@pcasl

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 !

Metadata

Metadata

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions