API Reference

nondefaced_detector.models: Model functions

nondefaced_detector.models

nondefaced_detector.models.model.ConvBNrelu(x)

A layer block of one convolutional, one batch normalization, and one non-linear activation sequence.

nondefaced_detector.models.model.TruncatedSubmodel(…)

The TruncatedSubmodel trained in Step 1 of the model.

nondefaced_detector.models.model.ClassifierHead(…)

The final block of the model

nondefaced_detector.models.model.Submodel(…)

3 identical submodel blocks are used to train on spatial information from all three axes (axial, coronal, sagittal) separately.

nondefaced_detector.models.model.CombinedClassifier([…])

The final block of the model that combines features and outputs a real-valued probability using the sigmoid function.

nondefaced_detector.dataloaders: Dataset functions

nondefaced_detector.dataloaders

nondefaced_detector.dataloaders.dataset.get_dataset(…)

Returns tf.data.Dataset after preprocessing from tfrecords for training and validation

nondefaced_detector.preprocess: Preprocess input volumes

Script to preprocess volumes

nondefaced_detector.preprocess

Script to preprocess volumes

nondefaced_detector.preprocess.preprocess(…)

Preprocess input volumes before prediction.

nondefaced_detector.preprocess.preprocess_parallel(…)

Preprocess multiple input volumes before prediction in parallel.

nondefaced_detector.prediction: Making predictions

Methods to predict using trained models

nondefaced_detector.prediction

Methods to predict using trained models

nondefaced_detector.prediction.predict(…)

Return predictions from a list of input volumes.

nondefaced_detector.prediction._structural_slice(x, …)

Transpose dataset and get slices from the volume based on the plane.

nondefaced_detector.prediction._get_model(…)

Return tf.keras.Model object from a filepath.

nondefaced_detector.inference: Inference

Standalone inference script for held-out test dataset.

nondefaced_detector.inference

Standalone inference script for held-out test dataset.

nondefaced_detector.inference.inference(…)

Inference function to reproduce original model scores.

nondefaced_detector.helpers: Helper functions

nondefaced_detector.helpers

nondefaced_detector.helpers.utils.is_gz_file(…)

nondefaced_detector.helpers.utils.save_vol(…)

save_path: path to write the volume to tensor_3d: 3D volume which needs to be saved affine: image orientation, translation

nondefaced_detector.helpers.utils.load_vol(…)

load_path: volume path to load :returns: loaded 3D volume affine: affine data specific to the volume :rtype: volume

nondefaced_detector.helpers.utils.imshow(img1)

nondefaced_detector.utils: Utility functions

Utilities for Nondefaced-detector.

nondefaced_detector.utils

Utilities for Nondefaced-detector.

nondefaced_detector.utils.get_datalad([…])

Download a datalad dataset/repo.