Mrregister: [ERROR] Error allocating memory for scratch buffer while executing population_template command


#1

I am trying to generate unbiased FOD template using three subjects. I use the command:

population_template fodimage -mask_dir maskimage fod_template.mif

I get error message: "mrregister: [ERROR] Error allocating memory for scratch buffer"
I am working on a system with RAM size 15GB. My system configuration as below:
Memory 15.6 GiB, Disk 928 GB, Graphics: Gallium 0.4 on NVE6, Processor: Intel® Core™ i7-3770 CPU @ 3.40GHz × 8

How I can remove this error, please help!

Here is the extract of the output of my command:---------
population_template: Generating a population-average template from 3 input images
population_template: SH Series detected, performing FOD registration
population_template: Generated temporary directory: /tmp/population_template-tmp-88C99P/
population_template: Changing to temporary directory (/tmp/population_template-tmp-88C99P/)
population_template: Generating initial template
Command: mraverageheader /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118932_fod.mif /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/123117_fod.mif /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118730_fod.mif average_header.mif -fill
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118932mask.mif -interp nearest -template average_header.mif masks_transformed/118932mask.mif
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/123117mask.mif -interp nearest -template average_header.mif masks_transformed/123117mask.mif
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118730mask.mif -interp nearest -template average_header.mif masks_transformed/118730mask.mif
Command: mrmath masks_transformed/118932mask.mif masks_transformed/123117mask.mif masks_transformed/118730mask.mif max mask_initial.mif
Command: mrcrop average_header.mif -mask mask_initial.mif average_header_cropped.mif
Command: rm -f mask_initial.mif
Command: rm -f average_header.mif
Command: mv average_header_cropped.mif average_header.mif
Command: rm masks_transformed/118932mask.mif
Command: rm masks_transformed/123117mask.mif
Command: rm masks_transformed/118730mask.mif
Command: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118932_fod.mif average_header.mif -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118932mask.mif -rigid_scale 1 -rigid_niter 0 -type rigid -noreorientation -rigid_init_translation mass -datatype float32 -rigid linear_transforms_initial/118932.txt
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118932_fod.mif -linear linear_transforms_initial/118932.txt -datatype float32 input_transformed/118932_translated.mif
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118932mask.mif -linear linear_transforms_initial/118932.txt -datatype float32 masks_transformed/118932_translated.mif
Command: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/123117_fod.mif average_header.mif -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/123117mask.mif -rigid_scale 1 -rigid_niter 0 -type rigid -noreorientation -rigid_init_translation mass -datatype float32 -rigid linear_transforms_initial/123117.txt
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/123117_fod.mif -linear linear_transforms_initial/123117.txt -datatype float32 input_transformed/123117_translated.mif
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/123117mask.mif -linear linear_transforms_initial/123117.txt -datatype float32 masks_transformed/123117_translated.mif
Command: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118730_fod.mif average_header.mif -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118730mask.mif -rigid_scale 1 -rigid_niter 0 -type rigid -noreorientation -rigid_init_translation mass -datatype float32 -rigid linear_transforms_initial/118730.txt
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118730_fod.mif -linear linear_transforms_initial/118730.txt -datatype float32 input_transformed/118730_translated.mif
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118730mask.mif -linear linear_transforms_initial/118730.txt -datatype float32 masks_transformed/118730_translated.mif
Command: mraverageheader input_transformed/118932_translated.mif input_transformed/123117_translated.mif input_transformed/118730_translated.mif average_header_tight.mif
Command: mrpad -uniform 10 average_header_tight.mif average_header.mif -force
Command: rm -f average_header_tight.mif
Command: mrtransform masks_transformed/118932_translated.mif masks_transformed/118932.mif -interp nearest -template average_header.mif -datatype float32
Command: mrtransform masks_transformed/123117_translated.mif masks_transformed/123117.mif -interp nearest -template average_header.mif -datatype float32
Command: mrtransform masks_transformed/118730_translated.mif masks_transformed/118730.mif -interp nearest -template average_header.mif -datatype float32
Command: mrmath masks_transformed/118932.mif masks_transformed/123117.mif masks_transformed/118730.mif max mask_translated.mif
Command: rm -f mask_translated_smooth.mif
Command: mrcrop average_header.mif -mask mask_translated.mif average_header_cropped.mif
Command: mrpad -uniform 10 average_header_cropped.mif -force average_header.mif
Command: rm -f average_header_cropped.mif
Command: mrtransform masks_transformed/118932_translated.mif masks_transformed/118932.mif -interp nearest -template average_header.mif -datatype float32 -force
Command: rm -f masks_transformed/118932_translated.mif
Command: mrtransform masks_transformed/123117_translated.mif masks_transformed/123117.mif -interp nearest -template average_header.mif -datatype float32 -force
Command: rm -f masks_transformed/123117_translated.mif
Command: mrtransform masks_transformed/118730_translated.mif masks_transformed/118730.mif -interp nearest -template average_header.mif -datatype float32 -force
Command: rm -f masks_transformed/118730_translated.mif
Command: rm -f mask_translated.mif
Command: mrtransform input_transformed/118932_translated.mif input_transformed/118932.mif -interp linear -template average_header.mif -datatype float32
Command: rm -f input_transformed/118932_translated.mif
Command: mrtransform input_transformed/123117_translated.mif input_transformed/123117.mif -interp linear -template average_header.mif -datatype float32
Command: rm -f input_transformed/123117_translated.mif
Command: mrtransform input_transformed/118730_translated.mif input_transformed/118730.mif -interp linear -template average_header.mif -datatype float32
Command: rm -f input_transformed/118730_translated.mif
Command: mrmath input_transformed/118932.mif input_transformed/118730.mif input_transformed/123117.mif mean initial_template.mif
population_template: Optimising template with linear registration
Command: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118932_fod.mif initial_template.mif -force -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118932mask.mif -affine_scale 0.3 -affine_niter 500 -affine_lmax 2 -type affine -datatype float32 -affine linear_transforms_0/118932.txt
Command: transformcalc linear_transforms_0/118932.txt decompose linear_transforms_0/118932.txtdecomp
Command: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/123117_fod.mif initial_template.mif -force -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/123117mask.mif -affine_scale 0.3 -affine_niter 500 -affine_lmax 2 -type affine -datatype float32 -affine linear_transforms_0/123117.txt
Command: transformcalc linear_transforms_0/123117.txt decompose linear_transforms_0/123117.txtdecomp
Command: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118730_fod.mif initial_template.mif -force -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118730mask.mif -affine_scale 0.3 -affine_niter 500 -affine_lmax 2 -type affine -datatype float32 -affine linear_transforms_0/118730.txt
Command: transformcalc linear_transforms_0/118730.txt decompose linear_transforms_0/118730.txtdecomp
Command: transformcalc linear_transforms_0/123117.txt linear_transforms_0/118932.txt linear_transforms_0/118730.txt average linear_transform_average.txt -force -quiet
Command: transformcalc linear_transform_average.txt invert linear_transform_average_inv.txt -force -quiet
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118932_fod.mif -template initial_template.mif -linear linear_transforms_0/118932.txt input_transformed/118932.mif -datatype float32 -force
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/123117_fod.mif -template initial_template.mif -linear linear_transforms_0/123117.txt input_transformed/123117.mif -datatype float32 -force
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118730_fod.mif -template initial_template.mif -linear linear_transforms_0/118730.txt input_transformed/118730.mif -datatype float32 -force
Command: mrmath input_transformed/118932.mif input_transformed/118730.mif input_transformed/123117.mif mean linear_template0.mif -force
Command: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118932_fod.mif linear_template0.mif -force -affine_init_matrix linear_transforms_0/118932.txt -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118932mask.mif -affine_scale 0.4 -affine_niter 500 -affine_lmax 2 -type affine -datatype float32 -affine linear_transforms_1/118932.txt
Command: transformcalc linear_transforms_1/118932.txt decompose linear_transforms_1/118932.txtdecomp
Command: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/123117_fod.mif linear_template0.mif -force -affine_init_matrix linear_transforms_0/123117.txt -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/123117mask.mif -affine_scale 0.4 -affine_niter 500 -affine_lmax 2 -type affine -datatype float32 -affine linear_transforms_1/123117.txt
Command: transformcalc linear_transforms_1/123117.txt decompose linear_transforms_1/123117.txtdecomp
Command: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118730_fod.mif linear_template0.mif -force -affine_init_matrix linear_transforms_0/118730.txt -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118730mask.mif -affine_scale 0.4 -affine_niter 500 -affine_lmax 2 -type affine -datatype float32 -affine linear_transforms_1/118730.txt
Command: transformcalc linear_transforms_1/118730.txt decompose linear_transforms_1/118730.txtdecomp
Command: transformcalc linear_transforms_1/123117.txt linear_transforms_1/118932.txt linear_transforms_1/118730.txt average linear_transform_average.txt -force -quiet
Command: transformcalc linear_transform_average.txt invert linear_transform_average_inv.txt -force -quiet
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118932_fod.mif -template linear_template0.mif -linear linear_transforms_1/118932.txt input_transformed/118932.mif -datatype float32 -force
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/123117_fod.mif -template linear_template0.mif -linear linear_transforms_1/123117.txt input_transformed/123117.mif -datatype float32 -force
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118730_fod.mif -template linear_template0.mif -linear linear_transforms_1/118730.txt input_transformed/118730.mif -datatype float32 -force
Command: mrmath input_transformed/118932.mif input_transformed/118730.mif input_transformed/123117.mif mean linear_template1.mif -force
Command: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118932_fod.mif linear_template1.mif -force -affine_init_matrix linear_transforms_1/118932.txt -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118932mask.mif -affine_scale 0.6 -affine_niter 500 -affine_lmax 2 -type affine -datatype float32 -affine linear_transforms_2/118932.txt
Command: transformcalc linear_transforms_2/118932.txt decompose linear_transforms_2/118932.txtdecomp
Command: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/123117_fod.mif linear_template1.mif -force -affine_init_matrix linear_transforms_1/123117.txt -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/123117mask.mif -affine_scale 0.6 -affine_niter 500 -affine_lmax 2 -type affine -datatype float32 -affine linear_transforms_2/123117.txt
Command: transformcalc linear_transforms_2/123117.txt decompose linear_transforms_2/123117.txtdecomp
Command: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118730_fod.mif linear_template1.mif -force -affine_init_matrix linear_transforms_1/118730.txt -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118730mask.mif -affine_scale 0.6 -affine_niter 500 -affine_lmax 2 -type affine -datatype float32 -affine linear_transforms_2/118730.txt
Command: transformcalc linear_transforms_2/118730.txt decompose linear_transforms_2/118730.txtdecomp
Command: transformcalc linear_transforms_2/123117.txt linear_transforms_2/118932.txt linear_transforms_2/118730.txt average linear_transform_average.txt -force -quiet
Command: transformcalc linear_transform_average.txt invert linear_transform_average_inv.txt -force -quiet
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118932_fod.mif -template linear_template1.mif -linear linear_transforms_2/118932.txt input_transformed/118932.mif -datatype float32 -force
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/123117_fod.mif -template linear_template1.mif -linear linear_transforms_2/123117.txt input_transformed/123117.mif -datatype float32 -force
Command: mrtransform /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118730_fod.mif -template linear_template1.mif -linear linear_transforms_2/118730.txt input_transformed/118730.mif -datatype float32 -force
Command: mrmath input_transformed/118932.mif input_transformed/118730.mif input_transformed/123117.mif mean linear_template2.mif -force
Command: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118932_fod.mif linear_template2.mif -force -affine_init_matrix linear_transforms_2/118932.txt -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118932mask.mif -affine_scale 0.8 -affine_niter 500 -affine_lmax 4 -type affine -datatype float32 -affine linear_transforms_3/118932.txt
population_template:
population_template: [ERROR] Command failed: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118932_fod.mif linear_template2.mif -force -affine_init_matrix linear_transforms_2/118932.txt -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118932mask.mif -affine_scale 0.8 -affine_niter 500 -affine_lmax 4 -type affine -datatype float32 -affine linear_transforms_3/118932.txt
population_template: Output of failed command:
mrregister: [ERROR] Error allocating memory for scratch buffer
population_template: Changing back to original directory (/home/koushik/HCP_Data/12-08-16/output_normalised_dwi)
population_template: Deleting temporary directory /tmp/population_template-tmp-88C99P/


Error during fixel-based-analysis: unrecognized arguments: -voxel_size 1.25
#2

Hello Sarbani,

Is your /tmp directory mounted as a tmpfs or ramfs? On linux, I think you can find out via cat /etc/fstab. Alternatively rerun poulation_template with -tempdir directory/on/your/hdd.

If this is negative then rerun poulation_template with -nocleanup and inspect the files in the temporary directory. In particular have a look at the last generated linear_template?.mif and check whether its dimensions are reasonable.

Cheers,
Max


#3

Just a quick note:

Actually, it’s probably best to use mount to query where /tmp is mounted - it gives you the list of actual mount points as currently active.


#4

Hi Max,

My /tmp is not mounted as “ramfs”.
Here is the extract of mount:

koushik@koushik-DQ77MK:~$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=8170992k,nr_inodes=2042748,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=1638056k,mode=755)
/dev/sda1 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=26,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1638056k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
/dev/sdb2 on /media/koushik/New Volume type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
koushik@koushik-DQ77MK:~$ mount | grep "tmpfs"
udev on /dev type devtmpfs (rw,nosuid,relatime,size=8170992k,nr_inodes=2042748,mode=755)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=1638056k,mode=755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1638056k,mode=700,uid=1000,gid=1000)

The size of the last generated linear_template2.mif file is 3.7GB.
And this is the output I am getting when change the scratch.cpp file (std::cout << "SRDB: Trying to allocate buffer of size "<< header.name() << "and " << buffer_size << std::endl;) to print the memory buffer size it is trying to allocating in the population_template command:

Command: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118932_fod.mif linear_template2.mif -force -affine_init_matrix linear_transforms_2/118932.txt -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118932mask.mif -affine_scale 0.8 -affine_niter 500 -affine_lmax 4 -type affine -datatype float32 -affine linear_transforms_3/118932.txt
population_template: 
population_template: [ERROR] Command failed: mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118932_fod.mif linear_template2.mif -force -affine_init_matrix linear_transforms_2/118932.txt -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118932mask.mif -affine_scale 0.8 -affine_niter 500 -affine_lmax 4 -type affine -datatype float32 -affine linear_transforms_3/118932.txt
population_template: Output of failed command:
SRDB: Trying to allocate buffer of size scratch image and 3512016000
SRDB: Trying to allocate buffer of size scratch image and 1756008000
SRDB: Trying to allocate buffer of size scratch image and 1756008000
SRDB: Trying to allocate buffer of size scratch image and 1756008000
SRDB: Trying to allocate buffer of size scratch image and 1756008000
SRDB: Trying to allocate buffer of size scratch image and 2498459040
SRDB: Trying to allocate buffer of size scratch image and 1249229520
SRDB: Trying to allocate buffer of size scratch image and 1249229520
SRDB: Trying to allocate buffer of size scratch image and 1249229520
SRDB: Trying to allocate buffer of size scratch image and 1249229520
SRDB: Trying to allocate buffer of size scratch image and 3512016000
SRDB: Trying to allocate buffer of size scratch image and 2498459040
SRDB: Trying to allocate buffer of size scratch image and 3512016000
mrregister: [ERROR] Error allocating memory for scratch buffer
population_template: Changing back to original directory (/home/koushik/HCP_Data/12-08-16/output_normalised_dwi)
population_template: Contents of temporary directory kept, location: /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/tempfiles/population_template-tmp-9JRYZZ/

I also try to run debug mode but found that population_template is not in the list being a python script.

Please help to figure out why is this error, how I can remove.

Thanks & regards
Sarbani


#5

Hello Sarbani,

If those DWI files are of type 32bit float then I think I know why mrregister bails out. I’ll have a go at redcing the memroy footprint but just to make sure, could you please post the output of

mrinfo /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118932_fod.mif
cd ~/mrtrix3
git pull && git checkout registration_memory
./build
cd /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/tempfiles/population_template-tmp-9JRYZZ/
mrregister /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/fodimage/118932_fod.mif linear_template2.mif -force -affine_init_matrix linear_transforms_2/118932.txt -mask1 /home/koushik/HCP_Data/12-08-16/output_normalised_dwi/maskimage/118932mask.mif -affine_scale 0.8 -affine_niter 1 -affine_lmax 4 -type affine -datatype float32 -affine linear_transforms_3/118932.txt -debug

Cheers,
Max


#6

Hello Sarbani,

I have changed mrregister in the registration_memory branch to require 20% less peak memory. I hope your memory is now sufficient. If not then make sure that the input masks look ok and check the intermediate linear templates visually. One could further reduce the memory consumption by changing the floating point data type but it turns out that this requires substantial changes to the code.

How big is your input? I think 3.7GB is too large for normal HCP FOD data. For me, linear FOD templates for 10 subjects are smaller than 1GB.

Cheers,
Max


#7

Hi Sarbani,
Just to check, are you up-sampling the HCP data by a factor of 2 as per the fixel-based analysis instructions? If so this might be why you have larger images than expected. I’d recommend not up-sampling the HCP data since it’s already high enough resolution.

Also, what is the lmax of your images? While mrregister only computes the image metric on the SH coefficients up to lmax=4 by default, it still pre-loads the entire volume. If you have high lmax (>8) images then it could be taking up lots of RAM unnecessarily. Pre-loading the whole image is a hangover from when mrregister did not perform a multi-lmax ‘pyramid’ (i.e. go from lmax = 0, 2, then 4). I’ll modify this today so that it only loads the coefficients needed.
Cheers,
Dave


#8

Yes, it’s true. I was upsampling the data as per fixel -based analysis guideline.
Sarbani


#9

OK. I’ll update the documentation to recommend this only for typical DWI resolutions.