Skip to content

Instantly share code, notes, and snippets.

View afg1's full-sized avatar

Andrew Green afg1

View GitHub Profile
@afg1
afg1 / error_log.txt
Created February 9, 2023 09:56
Error log from trying to run `poetry add -vvvv git+https://github.com/afg1/pysam.git`
Stack trace:
1 ~/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/poetry/utils/env.py:1523 in _run
1521│
1522│ if input_:
→ 1523│ output = subprocess.run(
1524│ command,
1525│ stdout=subprocess.PIPE,
@afg1
afg1 / gist:f77cc9e08f69a417a5dba49fc636b660
Created February 7, 2023 11:28
pyproject.toml excerpt
<snip>
[tool.poetry.dependencies]
python = "^3.11"
PyMySQL = "^1.0.2"
attrs = "^21.4.0"
beautifulsoup4 = "^4.11.0"
biopython = "^1.79"
click = "^8.1.3"
click-aliases = "^1.0.1"
@afg1
afg1 / gist:83d3d462e0b96b54e9dd9ad4466658bd
Last active January 16, 2019 11:54
3D fcn network to reproduce bug in keras model.summary() output
import keras
from keras.layers import Conv3D, MaxPooling3D, Conv3DTranspose, Input
from keras.models import Model
def FCN3DNet():
inputLayerA = Input(shape=(96,96,96,1))
inputLayerB = Input(shape=(96,96,96,1))
totalInput = keras.layers.concatenate([inputLayerA, inputLayerB])
@afg1
afg1 / SimpleITKResampling
Created December 3, 2018 16:07
Example of resampling to a coarser image grid using SimpleITK
import SimpleITK as sitk
import numpy as np
## Just something I had lying around
inputImage = "ct.nii"
## Load the image. Must be a simpleITK image for this stage to work!
startImage = sitk.ReadImage(inputImage)
## factors to downsize by, this will take a 512x512x118 image to 128x128x118