-
-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG: Fix isAffine insuffcient precision in caluclations
Fixes #3333 Co-authored-by: Vladimir S. FONOV <vladimir.fonov@gmail.com>
- Loading branch information
Showing
4 changed files
with
77 additions
and
13 deletions.
There are no files selected for viewing
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
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
1 change: 1 addition & 0 deletions
1
Modules/IO/NIFTI/test/Input/SmallVoxels_AffinePrecision.nii.gz.sha512
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5afad4b7b6fe872a896ed7eb555a572dc893e8074555973aca1bff3d2c12f6549a6d79b88d8c869c4e0b514de8b049a92b74fc09765fa82cbb21494f4e6608d6 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/*========================================================================= | ||
* | ||
* Copyright NumFOCUS | ||
* | ||
* 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 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*=========================================================================*/ | ||
|
||
#include "itkNiftiImageIOTest.h" | ||
|
||
// Test to read small voxel NIFTI file which was triggering numerical instability | ||
// in IsAffine loading code | ||
int | ||
itkNiftiImageIOTest13(int argc, char * argv[]) | ||
{ | ||
if (argc != 2) | ||
{ | ||
return EXIT_FAILURE; | ||
} | ||
|
||
constexpr unsigned int Dimension = 3; | ||
|
||
using PixelType = float; | ||
using ImageType = itk::Image<PixelType, Dimension>; | ||
|
||
try | ||
{ | ||
using ReaderType = itk::ImageFileReader<ImageType>; | ||
ReaderType::Pointer reader = ReaderType::New(); | ||
reader->SetFileName(argv[1]); | ||
reader->Update(); | ||
ImageType::Pointer image = reader->GetOutput(); | ||
} | ||
catch (const itk::ExceptionObject & err) | ||
{ | ||
std::cerr << "ExceptionObject caught !" << std::endl; | ||
std::cerr << err << std::endl; | ||
return EXIT_FAILURE; | ||
} | ||
|
||
return EXIT_SUCCESS; | ||
} |