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
// Related to https://github.com/InsightSoftwareConsortium/ITK/pull/4347 | |
// PERF: Replace `std::function` with template argument MultiThreaderBase ParallelizeImageRegion, ParallelizeImageRegionRestrictDirection | |
// Niels Dekker, LKEB, Leiden University Medical Center, 2023 | |
#include <itkImageRegion.h> | |
#include <algorithm> | |
#include <chrono> | |
#include <numeric> | |
#include <vector> |
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
#include <chrono> | |
using namespace std::chrono; | |
const auto timePoint = high_resolution_clock::now(); | |
// Do the time consuming work here! | |
std::cout << " Duration: " | |
<< duration_cast<duration<double>>(high_resolution_clock::now() - timePoint).count() << " seconds" << std::endl; |
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
// 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 add in-class {} member initializers to ITK classes that have one or more virtual member function, | |
// itkNewMacro, itkSimpleNewMacro, or itkCreateAnotherMacro calls. | |
// | |
// Only tested with Visual Studio 2019 (C++14). | |
// | |
// Needs to have the directory path to the ITK sources as command-line argument, for example: |
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
/*========================================================================= | |
* | |
* Copyright UMC Utrecht and contributors | |
* | |
* 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 | |
* |
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
/* | |
Related to: | |
https://github.com/SuperElastix/elastix/pull/358#issuecomment-731736374 | |
Niels Dekker, LKEB, Leiden University Medical Center, 2020 | |
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. | |
*/ |
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
/* | |
Estimates the axis-aligned minimum bounding box of the buffered region of an image. | |
Roughly equivalent to ImageMaskSpatialObject::GetAxisAlignedBoundingBoxRegion() from | |
"itkImageMaskSpatialObject.hxx", at | |
github.com/InsightSoftwareConsortium/ITK/blob/91ab86f63eb5fc9799bb25fa49e76adf0d1b5251/Modules/Core/SpatialObjects/include | |
Related to: | |
"ENH: GTest for ImageMaskSpatialObject::GetAxisAlignedBoundingBoxRegion()" |
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
/* | |
Estimates the runtime duration that it takes to increase the capacity of | |
an `std::vector<itk::NeighborhoodAllocator<int>>`. | |
With VS2017, the `vector::reserve` in this test appears to run more than 4x faster, | |
now that `itk::NeighborhoodAllocator` has a move-constructor that is `noexcept`. | |
Related to the discussion, "Regarding C++11 noexcept" at the ITK forum: | |
https://discourse.itk.org/t/regarding-c-11-noexcept/1517 |
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
/* | |
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. |
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
/* | |
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. |
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
/* | |
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, |
NewerOlder