bruker2nifti package¶
Subpackages¶
Submodules¶
bruker2nifti.converter module¶
-
class
bruker2nifti.converter.Bruker2Nifti(pfo_study_bruker_input, pfo_study_nifti_output, study_name=None)¶ Bases:
objectFacade to collect users preferences on the conversion and accessing the core methods for the conversion (scan_to_struct, write_struct).
Nomenclature:
study: a series of acquisition related to the same subject, acquired in the same scanning session and usually containing multiple scans. It is provided as a folder structure containing the scans produced with paravision (PV) software. Patient/subject information are embedded in the study (opposed hierarchy as in the DICOM files).
scan or experiment, sub-scans and sub-volumes: individual folder image acquired with various protocols. To a scan can belong more than one processed image, or reconstruction. Each processed image can be a single volume or can contain more than one sub-volume embedded in the same processed image.
header: header of the nifti format.
img_data: data of the nifti format, stored in a 2d or 3d matrix.
struct: intermediate structure (python dictionary) proposed in this code, aimed at collecting the information from the raw Bruker and to progressively creating the nifti images.
-
convert()¶ To call the converter, once all the settings of the converter are selected and modified by the user. :return: Convert the Bruker study, whose path is stored in the class variable self.pfo_study_bruker_input in the specified folder stored in self.pfo_study_nifti_output, and according to the other class attributes.
Example:
>> bru = Bruker2Nifti(‘/path/to/my/study’, ‘/path/output’, study_name=’study1’)
>> bru.show_study_structure
>> bru.verbose = 2 >> bru.correct_slope = True >> bru.get_acqp = False >> bru.get_method = True # I want to see the method parameter file converted as well. >> bru.get_reco = False
>> # Convert the study: >> bru.convert()
-
convert_scan(pfo_input_scan, pfo_output_converted, nifti_file_name=None, create_output_folder_if_not_exists=True)¶ Parameters: - pfo_input_scan – path to folder (pfo) containing a scan from Bruker, see documentation for the difference between Bruker ‘scan’ and Bruker ‘study’.
- pfo_output_converted – path to the folder where the converted scan will be stored.
- create_output_folder_if_not_exists – [True] if the output folder does not exist will be created.
- nifti_file_name – [None] filename of the nifti image that will be saved into the pfo_output folder. If None, the filename will be obtained from the parameter file of the study.
Returns: [None] save the data parsed from the raw Bruker scan into a folder, including the nifti image.
-
explore_study()¶ Automatic filling of the advanced selections class attributes. It also checks if the given attributes are meaningful. :return:
-
show_study_structure()¶ Print to console the structure of the selected study. :return: [None] only print to console information.
-