You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These CT scans were 512 DICOM images (512X512 pixels) that were converted to a MINC volume using dcm2mnc. I've displayed the mincinfo of one of these volumes below:
I also have to do some image processing on these scans to remove a undesired background stage (stage_labelledis a label volume where I manually segmented the stage) but this has no effects on mincinfo.
#our raw scans contain embryos in different orientations. As such I need to use #rotational_minctracc which needs a mask . As such, I have copied and enlarged the mask to be (759 X 759 X 759) and attempted to run rotational_minctracc.py to align two separately autocropped embryos (test_autocrop.mnc and test_autocrop_target.mnc) but it results in the follwing error.
Peaks found in the source image (Distance Transform):
[2.16 0.96 3.6 ]
[1.025 0.25 4.925]
[-2.84 -0.24 -4. ]
[ 0.24571429 -0.95428574 -2.7428572 ]
[-0.24 -1.04 -1.8 ]
[2.4933333 0.22666667 0.13333334]
Making byte volume...
Using positive peak threshold 3010.32
Peaks found in the source image (blurred image):
[ 0.56 1.76 -2.2 ]
[-1.24 1.16 -1. ]
[-1.44 1.76 -2.4 ]
[-0.84 -1.04 -1.2 ]
Using positive peak threshold 10.4
Peaks found in the target image (Distance Transform):
[-0.44 -1.44 4.8 ]
[-2.24 -1.24 4. ]
[-1.04 -1.84 5.4 ]
Making byte volume...
Using positive peak threshold 2963.95
Peaks found in the target image (blurrred image):
[ 0.36 2.16 -2.4 ]
[ 1.16 1.96 -0.8 ]
[ 0.16 -1.24 -2. ]
Transforming slices:.......................................................................................................Done
Files //tmp//rot_17719/rot_2.mnc and //tmp//rot_17719/rot_5.mnc have different start coordinates (zspace)
Traceback (most recent call last):
File "/opt/miniconda/bin/rotational_minctracc.py", line 4, in import('pkg_resources').run_script('python-stuffs==0.1.24', 'rotational_minctracc.py')
File "/opt/miniconda/lib/python3.7/site-packages/pkg_resources/init.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/opt/miniconda/lib/python3.7/site-packages/pkg_resources/init.py", line 1460, in run_script
exec(script_code, namespace, namespace)
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 422, in
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 413, in main
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 240, in loop_rotations
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 162, in get_cross_correlation_from_coordinate_pair
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 108, in compute_xcorr
File "/opt/miniconda/lib/python3.7/subprocess.py", line 395, in check_output
**kwargs).stdout
File "/opt/miniconda/lib/python3.7/subprocess.py", line 487, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['minccmp', '-xcorr', '-mask', '//tmp//rot_17719/rot_2.mnc', '//tmp//rot_17719/rot_5.mnc', '//tmp//rot_17719/rot_1.mnc']' returned non-zero exit status 1.
Peaks found in the source image (Distance Transform):
[2.19 0.899 3.64 ]
[-2.71 -0.301 -4.06 ]
[-0.05054054 -0.9496487 -2.2708108 ]
[2.39 0.299 0.34 ]
[2.64 1.449 1.19 ]
[2.59 0.399 1.74 ]
Making byte volume...
Using positive peak threshold 3020.42
Peaks found in the source image (blurred image):
[ 0.69 1.699 -2.26 ]
[-1.51 1.499 -2.26 ]
[-1.31 1.099 -1.06 ]
[-0.91 -0.901 -1.06 ]
[-1.11 -1.301 -1.66 ]
Using positive peak threshold 7.2
Peaks found in the target image (Distance Transform):
[-2.71 -1.101 1.54 ]
[-2.3570588 -1.5480589 3.4694118]
[ 3.54 0.499 -3.46 ]
[-2.51 0.499 1.14 ]
[-0.31 -1.9471538 3.8476923]
[-0.21 -0.601 3.94 ]
Making byte volume...
Using positive peak threshold 2945.38
Peaks found in the target image (blurrred image):
[ 0.29 2.099 -2.26 ]
[ 1.29 1.899 -0.86 ]
[ 0.09 -1.101 -1.86 ]
[ 1.89 -0.901 -1.66 ]
Transforming slices:.......................................................................................................Done
Files //tmp//rot_17791/rot_2.mnc and //tmp//rot_17791/rot_5.mnc have different start coordinates (zspace)
Traceback (most recent call last):
File "/opt/miniconda/bin/rotational_minctracc.py", line 4, in import('pkg_resources').run_script('python-stuffs==0.1.24', 'rotational_minctracc.py')
File "/opt/miniconda/lib/python3.7/site-packages/pkg_resources/init.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/opt/miniconda/lib/python3.7/site-packages/pkg_resources/init.py", line 1460, in run_script
exec(script_code, namespace, namespace)
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 422, in
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 413, in main
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 240, in loop_rotations
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 162, in get_cross_correlation_from_coordinate_pair
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 108, in compute_xcorr
File "/opt/miniconda/lib/python3.7/subprocess.py", line 395, in check_output
**kwargs).stdout
File "/opt/miniconda/lib/python3.7/subprocess.py", line 487, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['minccmp', '-xcorr', '-mask', '//tmp//rot_17791/rot_2.mnc', '//tmp//rot_17791/rot_5.mnc', '//tmp//rot_17791/rot_1.mnc']' returned non-zero exit status 1.
The text was updated successfully, but these errors were encountered:
dorkylever
changed the title
rotational_minctracc .py has a type comparison error when comparing world co-ordinates
rotational_minctracc .py has a numeric type comparison error when comparing world co-ordinates
Sep 21, 2019
Using autocrop was the wrong approach as the world coordinates differed too much between my scans and the mask / initial model I was trying to use.
Instead, I was able to fix the start positions by using two sets of minctracc and mincresample, the first one with -tfm_input_sampling specified on mincresample and the second with -like specificied. I'll upload the exact code to the Arkell/Pydpiper repository when I get the chance.
Hi everyone,
I've being to trying to match some of our microCT scans of E15 embryos to the init_model available at http://www.mouseimaging.ca/technologies/mouse_atlas/mouse_embryo_atlas.html to ultimately ensure that rotational_minctracc.py does not fail when it is called in the MBM.py pipeline.
These CT scans were 512 DICOM images (512X512 pixels) that were converted to a MINC volume using dcm2mnc. I've displayed the mincinfo of one of these volumes below:
I also have to do some image processing on these scans to remove a undesired background stage (stage_labelledis a label volume where I manually segmented the stage) but this has no effects on mincinfo.
In comparison, both the model and mask that I am trying to convert/match our CT-scans to has the following properties:
To get these volumes to match I am running the folllowing commands:
#convert our scans to the right resolution/steps
#our raw scans contain embryos in different orientations. As such I need to use #rotational_minctracc which needs a mask . As such, I have copied and enlarged the mask to be (759 X 759 X 759) and attempted to run rotational_minctracc.py to align two separately autocropped embryos (test_autocrop.mnc and test_autocrop_target.mnc) but it results in the follwing error.
file: test_autocrop.mnc
image: unsigned short 0 to 65535
image dimensions: zspace yspace xspace
dimension name length step start
-------------- ------ ---- -----
zspace 759 0.027 -10.2
yspace 759 0.027 -10.24
xspace 759 0.027 -10.24
file: test_autocrop_target.mnc
image: unsigned short 0 to 65535
image dimensions: zspace yspace xspace
dimension name length step start
-------------- ------ ---- -----
zspace 759 0.027 -10.2
yspace 759 0.027 -10.24
xspace 759 0.027 -10.24
Peaks found in the source image (Distance Transform):
[2.16 0.96 3.6 ]
[1.025 0.25 4.925]
[-2.84 -0.24 -4. ]
[ 0.24571429 -0.95428574 -2.7428572 ]
[-0.24 -1.04 -1.8 ]
[2.4933333 0.22666667 0.13333334]
Making byte volume...
Using positive peak threshold 3010.32
Peaks found in the source image (blurred image):
[ 0.56 1.76 -2.2 ]
[-1.24 1.16 -1. ]
[-1.44 1.76 -2.4 ]
[-0.84 -1.04 -1.2 ]
Using positive peak threshold 10.4
Peaks found in the target image (Distance Transform):
[-0.44 -1.44 4.8 ]
[-2.24 -1.24 4. ]
[-1.04 -1.84 5.4 ]
Making byte volume...
Using positive peak threshold 2963.95
Peaks found in the target image (blurrred image):
[ 0.36 2.16 -2.4 ]
[ 1.16 1.96 -0.8 ]
[ 0.16 -1.24 -2. ]
Transforming slices:.......................................................................................................Done
Files //tmp//rot_17719/rot_2.mnc and //tmp//rot_17719/rot_5.mnc have different start coordinates (zspace)
Traceback (most recent call last):
File "/opt/miniconda/bin/rotational_minctracc.py", line 4, in
import('pkg_resources').run_script('python-stuffs==0.1.24', 'rotational_minctracc.py')
File "/opt/miniconda/lib/python3.7/site-packages/pkg_resources/init.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/opt/miniconda/lib/python3.7/site-packages/pkg_resources/init.py", line 1460, in run_script
exec(script_code, namespace, namespace)
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 422, in
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 413, in main
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 240, in loop_rotations
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 162, in get_cross_correlation_from_coordinate_pair
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 108, in compute_xcorr
File "/opt/miniconda/lib/python3.7/subprocess.py", line 395, in check_output
**kwargs).stdout
File "/opt/miniconda/lib/python3.7/subprocess.py", line 487, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['minccmp', '-xcorr', '-mask', '//tmp//rot_17719/rot_2.mnc', '//tmp//rot_17719/rot_5.mnc', '//tmp//rot_17719/rot_1.mnc']' returned non-zero exit status 1.
To match the co-ordinates between volumes:
file: test_world_coord.mnc
image: signed__ short -32768 to 32767
image dimensions: zspace yspace xspace
dimension name length step start
-------------- ------ ---- -----
zspace 760 0.027 -15.06
yspace 760 0.027 -8.701
xspace 760 0.027 -5.11
file: test_world_coord_target.mnc
image: signed__ short -32768 to 32767
image dimensions: zspace yspace xspace
dimension name length step start
-------------- ------ ---- -----
zspace 760 0.027 -15.06
yspace 760 0.027 -8.701
xspace 760 0.027 -5.11
#running rotational minctracc on corrected start spaces
Peaks found in the source image (Distance Transform):
[2.19 0.899 3.64 ]
[-2.71 -0.301 -4.06 ]
[-0.05054054 -0.9496487 -2.2708108 ]
[2.39 0.299 0.34 ]
[2.64 1.449 1.19 ]
[2.59 0.399 1.74 ]
Making byte volume...
Using positive peak threshold 3020.42
Peaks found in the source image (blurred image):
[ 0.69 1.699 -2.26 ]
[-1.51 1.499 -2.26 ]
[-1.31 1.099 -1.06 ]
[-0.91 -0.901 -1.06 ]
[-1.11 -1.301 -1.66 ]
Using positive peak threshold 7.2
Peaks found in the target image (Distance Transform):
[-2.71 -1.101 1.54 ]
[-2.3570588 -1.5480589 3.4694118]
[ 3.54 0.499 -3.46 ]
[-2.51 0.499 1.14 ]
[-0.31 -1.9471538 3.8476923]
[-0.21 -0.601 3.94 ]
Making byte volume...
Using positive peak threshold 2945.38
Peaks found in the target image (blurrred image):
[ 0.29 2.099 -2.26 ]
[ 1.29 1.899 -0.86 ]
[ 0.09 -1.101 -1.86 ]
[ 1.89 -0.901 -1.66 ]
Transforming slices:.......................................................................................................Done
Files //tmp//rot_17791/rot_2.mnc and //tmp//rot_17791/rot_5.mnc have different start coordinates (zspace)
Traceback (most recent call last):
File "/opt/miniconda/bin/rotational_minctracc.py", line 4, in
import('pkg_resources').run_script('python-stuffs==0.1.24', 'rotational_minctracc.py')
File "/opt/miniconda/lib/python3.7/site-packages/pkg_resources/init.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/opt/miniconda/lib/python3.7/site-packages/pkg_resources/init.py", line 1460, in run_script
exec(script_code, namespace, namespace)
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 422, in
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 413, in main
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 240, in loop_rotations
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 162, in get_cross_correlation_from_coordinate_pair
File "/opt/miniconda/lib/python3.7/site-packages/python_stuffs-0.1.24-py3.7.egg/EGG-INFO/scripts/rotational_minctracc.py", line 108, in compute_xcorr
File "/opt/miniconda/lib/python3.7/subprocess.py", line 395, in check_output
**kwargs).stdout
File "/opt/miniconda/lib/python3.7/subprocess.py", line 487, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['minccmp', '-xcorr', '-mask', '//tmp//rot_17791/rot_2.mnc', '//tmp//rot_17791/rot_5.mnc', '//tmp//rot_17791/rot_1.mnc']' returned non-zero exit status 1.
The text was updated successfully, but these errors were encountered: