Use synthstrip directly on a nparray

Objective

I’m trying to apply synthstrip directly in on a numpy array instead of a nifti file, so it’s part of a 100% python workflow, without disk operations nor nifti header available.

Current result

When I use a nifti file, which is the standard procedure, I have an expected result:

But when I use the numpy array from the exact same loaded nifti:
image

Method

The python script loads a nifti file here :

Here is the modification for testing purpose, which instead of feeding the nifti file, gives the array directly :

image_from_nifti = sf.load_volume(args.image)
image = sf.Volume(image_from_nifti.data) # feed the numpy array directly