Skip to content

Instantly share code, notes, and snippets.

cvlc --no-bluray-menu bluray:///dev/sr1#1 --sout "#std{access=file,mux=ts,dst=my_new_film.mkv}" vlc://quit
@bpinsard
bpinsard / subtract_nowrap.c
Last active February 24, 2020 16:45
Ufunc for numpy subtract 2 uint8 arrays element-wise without wrap of the values, set to zero instead
#include "Python.h"
#include "math.h"
#include "numpy/ndarraytypes.h"
#include "numpy/ufuncobject.h"
#include "numpy/npy_3kcompat.h"
/*
* subtract_nowrap.c
* This is a C code for ufunc that subtract 2 arrays element-wise and set to zero to avoid wrapping of negative results.
*
import numpy as np
import sys
import nibabel as nb
import nipy.algorithms.registration as nar
import dipy.align.vector_fields as vfu
from dipy.align.metrics import CCMetric
from dipy.align.imwarp import DiffeomorphicMap
from dipy.align.imwarp import SymmetricDiffeomorphicRegistration
import nibabel as nb
import nibabel.gifti
import numpy as np
import sys
def surfparc2vol(
lh_surf_file,rh_surf_file,lh_parc_file,rh_parc_file,parc_file,
out_fname,
mask=None,