Skip to content

Instantly share code, notes, and snippets.

View N-Dekker's full-sized avatar

Niels Dekker N-Dekker

  • LKEB, Leiden University Medical Center
View GitHub Profile
@N-Dekker
N-Dekker / GaussianDerivativeImageFunction_old_versus_WIP22926.cpp
Created January 9, 2018 18:51
Comparing ITK 4.13 implementation of GaussianDerivativeImageFunction::EvaluateAtIndex to http://review.source.kitware.com/#/c/22926/ (WIP)
// Author: Niels Dekker, LKEB, Leiden University Medical Center, The Netherlands
// Large parts of this code are from ITK, which has the following license:
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@N-Dekker
N-Dekker / CenterIsInsideCircle.cxx
Last active February 26, 2018 10:22
Checks that the center of a circle detected by HoughTransform2DCirclesImageFilter is inside the circle, using ITK 4.13
// Author: Niels Dekker, LKEB, Leiden University Medical Center, The Netherlands
//
// Example code from https://discourse.itk.org/t/hough-transform-2d-circles-image-filter-getcircles-patch/350/63
#include <itkHoughTransform2DCirclesImageFilter.h>
#include <itkImage.h>
#include <iostream>
int main()
{
@N-Dekker
N-Dekker / Move_DISALLOW_COPY_to_public_section.cpp
Created March 26, 2018 13:31
The script used for "COMP: Moved ITK_DISALLOW_COPY_AND_ASSIGN calls to public section", http://review.source.kitware.com/#/c/23289/ on Visual C++ 2017
// Script to move ITK_DISALLOW_COPY_AND_ASSIGN calls to the public section
// of the classes.
//
// Niels Dekker, LKEB, Leiden University Medical center, 2018
#include <cassert>
#include <cctype>
#include <deque>
#include <experimental/filesystem>
#include <fstream>
@N-Dekker
N-Dekker / itkTopologicalConnectivityImageNeighborhoodShape.h
Last active May 15, 2018 19:41
Early version of TopologicalConnectivityImageNeighborhoodShape (consider rename to simply "ConnectedImageNeighborhoodShape"!)
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
@N-Dekker
N-Dekker / FieldCreator.h
Created July 4, 2018 13:50
Proposed class to ease creating MeVisLab fields
/*=========================================================================
*
* Copyright Niels Dekker, LKEB, Leiden University Medical Center
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
@N-Dekker
N-Dekker / ItkDoxygenCodeBlockFix.cpp
Created October 4, 2018 18:08
Script to replace leading stars by spaces in Doxygen code blocks, for patch http://review.source.kitware.com/#/c/23782
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* Script to replace leading stars ('*') by spaces in Doxygen code blocks
* Used for patch http://review.source.kitware.com/#/c/23782/
*
* Initial version by Niels Dekker, LKEB, Leiden University Medical Center, 2018
*/
@N-Dekker
N-Dekker / ItkUnderscoredTestNamesToCamelCase.cpp
Created October 8, 2018 16:15
Script to remove underscores in test names and convert them to CamelCase, for patch http://review.source.kitware.com/#/c/23788/1
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* Script to remove underscores in test names and convert them to CamelCase.
* Used for patch "BUG: Removed underscores from GTest test names",
* http://review.source.kitware.com/#/c/23788/1
*
* Initial version by Niels Dekker, LKEB, Leiden University Medical Center, 2018
*/
@N-Dekker
N-Dekker / ConstNeighborhoodIteratorPerf.cxx
Created October 22, 2018 16:29
Measures performance of itk::ConstNeighborhoodIterator for http://review.source.kitware.com/#/c/23813
/*
Measures performance of "old-school" itk::ConstNeighborhoodIterator.
Related to the patch "PERF: Made ConstNeighborhoodIterator::GetPixel(i) much faster",
http://review.source.kitware.com/#/c/23813/.
Niels Dekker, LKEB, Leiden University Medical Center, 2018
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@N-Dekker
N-Dekker / ConstNeighborhoodIteratorGetPixelWithIsInBoundsPerf.cxx
Created October 24, 2018 16:01
Measures performance of ConstNeighborhoodIterator::GetPixel(i,isInBounds), related to http://review.source.kitware.com/#/c/23826 by Bradley Lowekamp
/*
Measures performance of "old-school" ConstNeighborhoodIterator::GetPixel(i, isInBounds)
Related to the patch "PERF: Improve ConstNeighborhoodIterator::GetPixel(i, isInBounds )",
http://review.source.kitware.com/#/c/23826/ by Bradley Lowekamp
Niels Dekker, LKEB, Leiden University Medical Center, 2018
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@N-Dekker
N-Dekker / CompareOldAndRangeBasedConstantBoundary.cxx
Last active November 7, 2018 17:19
Compares performance of "old-school" and new range-based neighborhood iteration using http://review.source.kitware.com/#/c/23795/7
/*
Compares performance of "old-school" neighborhood iteration, using
itk::ConstantBoundaryCondition, and range-based neighborhood iteration,
using the patch "WIP: Added policy for constant NeighborhoodRange values
outside image", http://review.source.kitware.com/#/c/23795/7.
Niels Dekker, LKEB, Leiden University Medical Center, 2018
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,