Skip to content

Instantly share code, notes, and snippets.

@Bekovmi
Bekovmi / NiftiReader.py
Created March 30, 2020 15:10
A new Nifti Reader for the Catalyst Framework
from catalyst.data import ReaderSpec
import nibabel as nib
import os
import numpy as np
import math
def zero_pad_array(array, d, w, h):
'''Function to pad tensors with zeros to same batch_size
Args:
array (numpy array): The tensor that is to be padded