the help of bart copy (bart copy -h) tells me what it supposedly does:
Copy an array (to a given position in the output file - which then must exist).
From this I assume that data from array a is copied into a position of array b, overwriting what's already in those positions, and implicitely not modifying the rest of array b.
However, when I use it, array b is actually completely cleared, and only the data from array b is still there. So either the description is unclear, or the behavior is not as intended.
#now extract the 2nd half of the phantom and scale it with factor 1.2 (make it a bit brighter)
bart extract 1 64 128 phantom phantom_right
bart scale 1.2 phantom_right phantom_right
bart toimg phantom_right phantom_right.png
# copy the scaled portion back into a copy of the original array
cp phantom.cfl phantom_copied.cfl
cp phantom.hdr phantom_copied.hdr
bart copy 1 64 phantom_right phantom_copied
bart toimg phantom_copied phantom_copied.png
I would expect the image to be a complete phantom, with the right half to be a bit brighter than the left half. Instead, the left half is completely lost.
For the intended result, I have to also extract the other portion of the data and stitch it together:
# join left and right half
bart extract 1 0 64 phantom phantom_left
bart toimg phantom_left phantom_left.png
bart join 1 phantom_left phantom_right phantom_joined
bart toimg phantom_joined phantom_joined.png
Hi,
the help of bart copy (
bart copy -h
) tells me what it supposedly does:From this I assume that data from array a is copied into a position of array b, overwriting what's already in those positions, and implicitely not modifying the rest of array b. However, when I use it, array b is actually completely cleared, and only the data from array b is still there. So either the description is unclear, or the behavior is not as intended.
I added a demo below.
Best, Dario
Demo:
I would expect the image to be a complete phantom, with the right half to be a bit brighter than the left half. Instead, the left half is completely lost. For the intended result, I have to also extract the other portion of the data and stitch it together: