MIR.utils.other_utilsΒΆ

Miscellaneous utility helpers for MIR.

Functions

SLANT_label_reassign(label_map)

Reassign SLANT label IDs to contiguous indices.

create_zip(zip_filename, source_dir)

Create a deflate-compressed zip file from a directory.

load_partial_weights(model, checkpoint_path)

Load weights from a checkpoint into a model, skipping unmatched layers.

pkload(fname)

Load a pickled object from disk.

process_label()

Build the lookup from contiguous label index to FreeSurfer structure name.

savepkl(data, path)

Save an object to a pickle file.

write2csv(line, name)

Append a line to a CSV file.

zoom_img(img, pixel_dims[, order])

Resample a 3D image from its voxel spacing to a target spacing with scipy.ndimage.zoom.

Classes

CenterCropPad3D(*args, **kwargs)

Crop or pad a 3-D medical image tensor so the spatial size becomes exactly target_size = (X, Y, Z).