Skip to content

Commit

Permalink
Have gaussian_filter plugin operate on copy of input so it does not m…
Browse files Browse the repository at this point in the history
…odify it in-place (#300)

* add .idea/ to gitignore

* gaussian_filter plugin operates on a copy, so does not modify input

* make inplace modification an option in gaussian_filter plugin

---------

Co-authored-by: Erik Schomburg <[email protected]>
  • Loading branch information
eschombu and eschombu authored Feb 24, 2024
1 parent cbd53f2 commit 97ed0b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jwu
*.egg-info/
.ipynb_checkpoints/
.vscode/
*.idea/
docker/inference/build_docker.sh
docker/inference/pytorch-emvision/
docker/inference/pytorch-model/
Expand Down
5 changes: 4 additions & 1 deletion chunkflow/plugins/gaussian_filter.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import numpy as np
from chunkflow.chunk import Chunk

from scipy.ndimage import gaussian_filter


def execute(chunk: Chunk, sigma: float=1.):
def execute(chunk: Chunk, sigma: float=1., inplace=False):
if not inplace:
chunk = chunk.clone()
for z in range(chunk.shape[-3]):
if chunk.ndim == 4:
for channel in range(chunk.shape[0]):
Expand Down

0 comments on commit 97ed0b0

Please sign in to comment.