Skip to content

Instantly share code, notes, and snippets.

View jcreinhold's full-sized avatar

Jacob Reinhold jcreinhold

View GitHub Profile
@jcreinhold
jcreinhold / gan_toy_examples.ipynb
Created September 20, 2020 18:09
Fitting a toy distribution with a variety of GANs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcreinhold
jcreinhold / tiramisu.py
Last active January 28, 2022 17:49
Tiramisu 2D/3D in PyTorch
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
PyTorch implementation of the Tiramisu network architecture [1]
(2D) Implementation based on [2].
Changes from [2] include:
1) removal of bias from conv layers,
2) change zero padding to replication padding,
3) use of GELU for default activation,
@jcreinhold
jcreinhold / normalize-ct-torch.py
Created December 9, 2021 16:28
normalize ct images in pytorch
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Normalize the intensity of a CT image
Author: Jacob Reinhold
"""
import sys
from argparse import ArgumentParser
from pathlib import Path
from typing import Tuple, Union
@jcreinhold
jcreinhold / normalize_ct.py
Last active December 8, 2021 18:00
Normalize CT images for a given tissue range
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Normalize the intensity of a CT image
Author: Jacob Reinhold
"""
import sys
from argparse import ArgumentParser
from pathlib import Path
from typing import Tuple, Union
@jcreinhold
jcreinhold / normalize-tissue.py
Created November 23, 2021 21:38
normalize by tissue mean
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Normalize the intensity of a set of images by
finding a tissue mean in the foreground and
voxel-wise dividing the image by that value
Author: Jacob Reinhold
"""
import os
import re
@jcreinhold
jcreinhold / normalize-mode.py
Created November 23, 2021 21:11
normalize intensity of images by dividing images of a specified intensity peak in histogram
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Normalize the intensity of a set of images by
finding a specified peak of each image foreground intensity
and voxel-wise dividing the image by that value
Author: Jacob Reinhold
"""
import os
import re
@jcreinhold
jcreinhold / normalize-percentile-foreground.py
Created November 23, 2021 19:53
normalize all images in a directory by the percentile of the estimated foreground
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Normalize the intensity of a set of images by
finding the specified percentile of each image
foreground and voxel-wise dividing the image by that value
Author: Jacob Reinhold
"""
import os
import re
@jcreinhold
jcreinhold / normalize-percentile.py
Created November 23, 2021 18:01
divide the intensity of a set of medical images by the percentile of the dataset
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Normalize the intensity of a set of images by
finding the median 99th percentile of all images
and dividing each image by that value
Author: Jacob Reinhold
"""
import os
import re
@jcreinhold
jcreinhold / filter_with_fft.ipynb
Last active September 10, 2021 17:05
Filter in frequency w/ zero padding
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcreinhold
jcreinhold / reading_memory_dnn.ipynb
Last active August 10, 2021 06:27
Reading memory in a DNN with ST Gumbel-softmax
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.