mdoc#
- class cryocat.core.mdoc.Mdoc(file_path=None, titles=None, project_info=None, imgs=None, section_id='ZValue')#
Bases:
objectClass for reading, writing, and manipulating Mdoc files.
- add_field(field_name, field_value)#
- change_frame_path(new_path=None)#
- convert_section_type(new_section_id='FrameSet')#
- get_image(index)#
- get_image_by_zvalue(zvalue)#
- get_image_by_zvalue_range(zvalue_min, zvalue_max)#
- get_image_feature(feature)#
- get_image_features(features)#
- get_images(indices)#
- get_images_by_zvalue_ranges(zvalue_ranges)#
- get_images_by_zvalues(zvalues)#
- keep_image(index)#
- keep_images(indices)#
- kept_images()#
- remove_image(index)#
- remove_images(indices, kept_only=True)#
- removed_images()#
- reorder_images(indices)#
- reset_images()#
- sort_by_tilt(reset_z_value=False)#
- update_pixel_size(new_pixel_size)#
- write(out_path=None, overwrite=False, removed=False)#
- cryocat.core.mdoc.get_tilt_angles(input_mdoc, output_file=None)#
- cryocat.core.mdoc.merge_mdoc_files(mdoc_path, new_id=None, reorder=True, stripFramePath=False, output_file=None)#
- cryocat.core.mdoc.remove_images(input_mdoc, idx_to_remove, numbered_from_1=True, output_file=None)#
- cryocat.core.mdoc.sort_mdoc_by_tilt_angles(input_mdoc, reset_z_value=False, output_file=None)#
- cryocat.core.mdoc.split_mdoc_file(input_mdoc, new_id=None, output_folder=None)#
- cryocat.core.mdoc.update_mdoc_features(mdoc_path, features_dict, output_file=None)#
Update a specific entry in the mdoc file.
- Parameters:
- mdoc_pathstr
Path to the mdoc file to be updated.
- features_dictdict
Dictionary containing the features to be updated as keys and their new value.
- output_filestr, optional, default=None
Path to save the updated mdoc file. If None, no updated file is saved.
- Returns:
- Mdoc
The updated Mdoc object.
- Raises:
- KeyError
If the specified feature is not found in the project info or image data.