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
# -*- coding: utf-8 -*- | |
import re | |
import warnings | |
from collections import namedtuple | |
from pathlib import Path | |
"""GOCAD Object file template: | |
GOCAD <type> <version> | |
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
macro "Batch rotate images and annotations" { | |
/* Read images in a chosen directory and rotate them along | |
with the annotations (points) and store them inplace */ | |
source_dir = getDirectory("Choose an input Directory "); // window to select the input directory | |
dest_dir = getDirectory("Choose an output Directory "); // window to select the output directory | |
list = getFileList(source_dir); // list files in it | |
angle = getNumber("choose the clockwise rotation angle", 90); | |
setBatchMode(true); // activate batch process |
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 | |
from numba import jit | |
from typing import Sequence | |
# @jit(nopython=True) | |
def flood_fill_labels(data: np.ndarray, seeds: Sequence[Sequence[int]]=[]) -> np.ndarray: | |
"""Labels an array using a flood fill algorithm | |
The function implements a flooding algorithm | |
considering a connectivity equals to the 2*data.ndim |
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
# Contact: Thomas Janvier <thomas.p.janvier@gmail.com> | |
itk_fetch_module(Thickness3D | |
"Tools for 3D thickness measurement" | |
GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKBinaryThinning3D.git | |
GIT_TAG <TODO: add the latest valid commit tag found on https://github.com/InsightSoftwareConsortium/ITKThickness3D/commits/master> | |
) |
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
macro "Batch export XY coordinates" { | |
/* Read images in a chosen directory and export measurements | |
XY coordinates (in pixels) in a .txt file with the same name */ | |
dir = getDirectory("Choose a Directory "); // window to select the input directory | |
list = getFileList(dir); // list files in it | |
setBatchMode(true); // activate batch process | |
for (i=0; i<list.length; i++) { // loop over files | |
showProgress(i, list.length); // update progressbar | |
file_name = list[i]; |