This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Edges": { | |
"53330552": { | |
"Type": "LineSegment", | |
"Vertices": [ | |
10212927, | |
43495525 | |
] | |
}, | |
"24807479": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nrrd # pip install pynrrd | |
import nibabel as nib # pip install nibabel | |
import numpy as np | |
# load nrrd | |
_nrrd = nrrd.read('/path/to/nrrd.nrrd') | |
data = _nrrd[0] | |
header = _nrrd[1] | |
print data.shape, header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assumes CT image nrrds with minimum value of -1024 | |
# assumes CT mask nrrds with 0's and 1's | |
# assumes the shape of each patient data (iamge and mask) are different - therefore, | |
# this will pad all images and masks to the size of the largest | |
# does not preform any interpolation to isotrpic voxels or any normalization | |
# only saves the image and mask, therefore the metadata and pixel spacing is lost | |
import nrrd # pip install pynrrd # probably better performance with sitk | |
import numpy as np | |
import glob |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import plotly | |
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot | |
import plotly.graph_objs as go | |
init_notebook_mode(connected=True) | |
from plotly import tools | |
import scipy.signal as signal | |
from scipy.interpolate import interp1d | |
# myX - x axis values |