Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

itk::ERROR: RandomCoordinateSampler Please select a smaller SampleRegionSize! #35

Open
pforai opened this issue Sep 24, 2019 · 0 comments

Comments

@pforai
Copy link

pforai commented Sep 24, 2019

Hi guys!

I'm hitting the following issue in our end and not sure how to deal with this when running with Elastix 4.9

I'm using a Singularity image
with the following defs

Bootstrap:docker
From:ubuntu:16.04

%post
# Create a directory for working with ClearMap
mkdir clearmap
# Set this as working directory
cd clearmap

# Install the neccessary Ubuntu packages
apt-get update
apt-get install -y python2.7
apt-get install -y python-pip
apt-get install -y python-dev
apt-get install -y build-essential
apt-get install -y wget
apt-get install -y bzip2
apt-get install -y unzip
apt-get install -y libgomp1
apt-get install -y python-opencv
apt-get install -y cython
apt-get install -y python-tifffile
apt-get install -y python-h5py
apt-get install -y python-natsort
apt-get install -y python-scipy
apt-get install -y python-networkx
apt-get install -y python-numpy

# Installing neccessary python packages
#pip install --upgrade pip
#pip install Cython
pip install numpy==1.13
#pip install matplotlib
pip install scikit-image==0.12.3

# Copy additional ClearMap resources.
# Included in the docker repo to combat any future
# changes to the iDisco website.
wget https://idiscodotinfo.files.wordpress.com/2016/05/clearmap_ressources_mouse_brain.zip
unzip clearmap_ressources_mouse_brain.zip
rm clearmap_ressources_mouse_brain.zip
rm -r __MACOSX
mv ClearMap_ressources resources

# Programmatically set the version of Elastix to pull.
export ElastixVersion="4.9.0"

# Download a release of Elastix.
# Development deemed stable (July, 2018).
#wget https://github.com/SuperElastix/elastix/releases/download/${ElastixVersion}/elastix-${ElastixVersion}-linux.tar.bz2
#tar xvjf elastix-4.9.0-linux.tar.bz2
#rm elastix-4.9.0-linux.tar.bz2

wget https://github.com/SuperElastix/elastix/archive/elastix_04_8.tar.gz
tar xzvf elastix_04_8.tar.gz
rm elastix_04_8.tar.gz


# Cleaning / reorganizing binaries and libraries.
mv bin/* /bin
mv lib/* /lib
rm -r bin && rm -r lib

# Keeping the original license (good practice).
mkdir elastix_metadata
mv LICENSE elastix_metadata && mv NOTICE elastix_metadata

# Updating the bashrc
#echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib" >> ~/.bashrc

# Install our custom ClearMap
pip install https://github.com/LernerLab/ClearMap/zipball/master

And the issue I'm seeing is this one

Current time: Tue Sep 24 12:01:52 2019.
Reading the elastix parameters from file ...

TIFFReadDirectory: Warning, Unknown field with tag 50838 (0xc696) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 50839 (0xc697) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 50838 (0xc696) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 50839 (0xc697) encountered.
ELASTIX version: 4.900
Command line options from ElastixBase:
-f        /groups/keays/Pascal/Mole-rat/Clearing/Mole_rat_MagStim2018/Caudal/Clearmaptest/autofluo_resampled.tif
-m        /groups/keays/Lukas/Clearedbrains2017/MRIBrainsI/ClearMap_ressources/25umAutofluoReference/molerat_brain_template/c13_back_488_50_25um_testcrop.tif
-fMask    unspecified, so no fixed mask used
-mMask    unspecified, so no moving mask used
-out      /groups/keays/Pascal/Mole-rat/Clearing/Mole_rat_MagStim2018/Caudal/Clearmaptest/elastix_auto_to_atlas/
-p        /groups/keays/Lukas/Clearedbrains2017/MRIBrainsI/ClearMap_ressources/Par0000affine.txt
-p        /groups/keays/Lukas/Clearedbrains2017/MRIBrainsI/ClearMap_ressources/Par0000bspline.txt
-threads  16
WARNING: The parameter "UseDirectionCosines", requested at entry number 0, does not exist at all.
  The default value "true" is used instead.

WARNING: The option "UseDirectionCosines" was not found in your parameter file.
  From elastix 4.8 it defaults to true!
This may change the behavior of your registrations considerably.

Command line options from TransformBase:
-t0       unspecified, so no initial transform used
WARNING: The parameter "BSplineTransformSplineOrder", requested at entry number 0, does not exist at all.
  The default value "3" is used instead.
WARNING: The parameter "UseCyclicTransform", requested at entry number 0, does not exist at all.
  The default value "false" is used instead.

Reading images...
Reading images took 0 ms.

WARNING: the fixed pyramid schedule is not fully specified!
  A default pyramid schedule is used.
WARNING: the moving pyramid schedule is not fully specified!
  A default pyramid schedule is used.
Initialization of all components (before registration) took: 11 ms.
Preparation of the image pyramids took: 268 ms.

Resolution: 0
WARNING: The parameter "UseMultiThreadingForMetrics", requested at entry number 0, does not exist at all.
  The default value "true" is used instead.
Setting the fixed masks took: 0 ms.
Setting the moving masks took: 0 ms.

itk::ExceptionObject (0x534d000)
Location: "ElastixTemplate - Run()"
File: /home/mstaring/tmp_elastix_release_4.9.0/elastix/Components/ImageSamplers/RandomCoordinate/elxRandomCoordinateSampler.hxx
Line: 113
Description: itk::ERROR: RandomCoordinateSampler(0x535edd0): ERROR: in your parameter file you selected
  SampleRegionSize[ 2 ] = 50 mm,
  while the fixed image size at dim = 2 is 40 voxels or 40 mm.
  Please select a smaller SampleRegionSize!
  It is recommended to be not larger than 1/3 of the image size in mm.

Error occurred during actual registration.


Errors occurred!
Traceback (most recent call last):

Any idea what to tweak/change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant