I’m wondering if there is a way to run mrtransform on multiple inputs at the same time without preloading the warp each time?
The reason is that I have a large number of ROI’s I want transformed with the same warp, but every time I “for loop” through mrtransform for each ROI it preloads a 1GB warp, and that is taking a lot of time on my computer through a network drive.
Having looked through the “foreach” script, I think this will behave the same as a “for loop”.
One way to overcome this would be to concatenate the 3D ROI images into a single 4D image. You can then run
mrtransform just once on the 4D image. In turn, you can extract the individual (warped) ROIs from the (warped) 4D image again.
Other than that, you’re right in that this is quite a common scenario; I agree it might be a worthwhile future addition to allow
mrtransform to run on multiple input images. I’ve come across this quite a few times recently, both myself and via others asking me essentially the same question. In those cases though, the preload wasn’t as critical as yours.
Thanks. Thats a good solution. I had thought (and tried) to concantenate the ROIs into a 3D image, but then it was proving difficult to extract them after the warp. A 4D image should work well.