users > Warp output unreadable in reformatx
Showing 1-6 of 6 posts
Display:
Results per page:
Dec 3, 2017  07:12 PM | Dan Xie - UCSF
Warp output unreadable in reformatx
Hi Developers,

I was trying to register between two stacks with the following commands:

cmtk  make_initial_affine --centers-of-mass "refbrain/RFP_temp.nrrd" "images/B1ZDunsharp.nrrd" "Registration/affine/aff_init.xform"

cmtk registration -v --mi --initial "Registration/affine/aff_init.xform" --auto-multi-levels 4 --match-histograms --dofs 6,12 -o "Registration/affine/affRFPB1ZD.xform" "refbrain/RFP_temp.nrrd" "images/B1ZDunsharp.nrrd"

cmtk warp -v -o "Registration/warp/warpRFPB1ZD.xform" --grid-spacing 2 --refine 6 --jacobian-weight 0.05 --rigidity-weight 0.1 --exploration 0.05 --accuracy 0.001 --match-histograms --exact-spacing --mi --output-intermediate --initial "Registration/affine/affRFPB1ZD.xform" "refbrain/RFP_temp.nrrd" "images/B1ZDunsharp.nrrd"

Then I tried to apply the registration to the original stack by:

cmtk reformatx -v -o reformB1ZD_warp.nrrd --floating images/B1ZDunsharp.nrrd refbrain/RFP_temp.nrrd Registration/warp/warpRFPB1ZD.xform


However, the reformatx never worked. It always gives the error message
"The file/directory Registration/warp/warpRFPB1ZD.xform does not seem to be in a supported transformation format"

Do you have any suggestions what could lead to the problem? Thanks!

Best.
Dan
Dec 9, 2017  06:12 PM | Torsten Rohlfing
RE: Warp output unreadable in reformatx
Hi Dan -

Sorry for the delay in responding.

I don't see anything obviously wrong with your command lines, so rather than guessing, would you mind uploading the transformation some place so I can take a look?

Also, in the same context (same working dir etc) as the reformatx command, what does output "ls -l Registration/warp/warpRFPB1ZD.xform" produce?

Thanks!
Torsten
Dec 29, 2017  04:12 PM | Dan Xie - UCSF
RE: Warp output unreadable in reformatx
Hi Torsten,

Sorry for my delayed reply. I ran several tests (using munger script instead, not the commands that I posted earlier here) with different data sets and here is my finding: for outputs that are readable in reformatx, the output folder contains files like:

cmd.sh level-01.list level-03.list level-05.list settings studylist
level-00.list level-02.list level-04.list registration.gz statistics

While for those unreadable in reformatx, the "registration.gz" is missiing. Sometimes even everything is missing except "cmd.sh".  I was wondering what makes this happen.  I have double checked all my data format and units to make sure that they are consistent.
Dec 29, 2017  06:12 PM | Torsten Rohlfing
RE: Warp output unreadable in reformatx
Hi Dan -

If the "registration.gz" file is missing, then there is no transformation stored in your output directory, which would certainly explain why you cannot read it.

So really, the question is, why the files aren't written sometimes. I assume you're not out of disk space? (Sorry, I have to ask)

The only reason I can think of why the registration.gz file isn't written is that the tool that produces it (warpx?) crashes either during registration or during file writing. Do you have any outputs logged from the commands that produces incomplete outputs?

Best,
  Torsten
Dec 29, 2017  09:12 PM | Dan Xie - UCSF
RE: Warp output unreadable in reformatx
Hi Torsten, 

I am for sure not running out of disk space, so I guess the registration step got crashed.  One trial that failed to proceed to warping gives this logged output:

hostname = ad8; short hostname = ad8
User path is /usr/local/sge/bin/linux-x64:/tmp/172508.1.long.q:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
Reference brain is refbrain/RFP_temp.nrrd
Reference brain stem is RFP
JOB ID =
Start time is: 1514577682 seconds
Root directory is /netapp/home/danustc/cmtkRegistration
Found brain name Jun13B2control (images/Jun13B2control.nrrd)
New working directory is: /netapp/home/danustc/cmtkRegistration, Old one was /netapp/home/danustc/cmtkRegistration
MYEXEC: CMD = mkdir -p Registration/affine/RFP_Jun13B2control_9dof.list exited with value 0
A: Running affine reg with command: /netapp/home/danustc/cmtk-build/bin/registration -i -v --dofs 6 --dofs 9 --dofs 6,12 --mi --accuracy 4 -o Registration/affine/RFP_Jun13B2control_9dof.list refbrain/RFP_temp.nrrd images/Jun13B2control.nrrd
INFO: number of threads set to 4 according to environment variable CMTK_NUM_THREADS
WARNING: image does not have valid orientation meta information; cannot reorient.
WARNING: image does not have valid orientation meta information; cannot reorient.


Another example that has unreadable warp results has the following logged output:

[color=#0000ff]hostname = id60; short hostname = id60
User path is /usr/local/sge/bin/linux-x64:/tmp/172498.1.long.q:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
Reference brain is refbrain/RFP_temp.nrrd
Reference brain stem is RFP
JOB ID =
Start time is: 1514576542 seconds
Root directory is /netapp/home/danustc/cmtkRegistration
Found brain name Jun06A2GCDA (images/Jun06A2GCDA.nrrd)
New working directory is: /netapp/home/danustc/cmtkRegistration, Old one was /netapp/home/danustc/cmtkRegistration
MYEXEC: CMD = mkdir -p Registration/affine/RFP_Jun06A2GCDA_9dof.list exited with value 0
A: Running affine reg with command: /netapp/home/danustc/cmtk-build/bin/registration -i -v --dofs 6 --dofs 9 --dofs 6,12 --mi --accuracy 4 -o Registration/affine/RFP_Jun06A2GCDA_9dof.list refbrain/RFP_temp.nrrd images/Jun06A2GCDA.nrrd
INFO: number of threads set to 4 according to environment variable CMTK_NUM_THREADS
WARNING: image does not have valid orientation meta information; cannot reorient.
WARNING: image does not have valid orientation meta information; cannot reorient.
Entering resolution level 1 out of 5...
Entering resolution level 1 out of 5...
Entering resolution level 1 out of 5...
Entering resolution level 1 out of 5...
Entering resolution level 2 out of 5...
Entering resolution level 2 out of 5...
Entering resolution level 2 out of 5...
Entering resolution level 2 out of 5...
Entering resolution level 3 out of 5...
Entering resolution level 3 out of 5...
Entering resolution level 3 out of 5...
Entering resolution level 3 out of 5...
Entering resolution level 4 out of 5...
Entering resolution level 4 out of 5...
Entering resolution level 4 out of 5...
Entering resolution level 4 out of 5...
Entering resolution level 5 out of 5...
Entering resolution level 5 out of 5...
Entering resolution level 5 out of 5...
Entering resolution level 5 out of 5...
Resulting transformation parameters:
#0d: 5.990000
#1d: -27.700000
#2d: 86.000000
#3d: 1.782642
#4d: -1.175570
#5d: 0.000000
#6d: 1.021623
#7d: 1.291911
#8d: 0.771295
#9d: 0.000000
#10d: 0.009980
#11d: 0.003327
#12d: 143.812500
#13d: 106.642500
#14d: 59.500000
MYEXEC: CMD = /netapp/home/danustc/cmtk-build/bin/registration -i -v --dofs 6 --dofs 9 --dofs 6,12 --mi --accuracy 4 -o Registration/affine/RFP_Jun06A2GCDA_9dof.list refbrain/RFP_temp.nrrd images/Jun06A2GCDA.nrrd exited with value 0
inlist = Registration/affine/RFP_Jun06A2GCDA_9dof.list
W: outlist = Registration/warp/RFP_Jun06A2GCDA_warp_m0g160c8e1e-1x52r2.list
MYEXEC: CMD = mkdir -p "Registration/warp/RFP_Jun06A2GCDA_warp_m0g160c8e1e-1x52r2.list" exited with value 0
W: Running warp reg with command: /netapp/home/danustc/cmtk-build/bin/warp -v --registration-metric nmi --jacobian-weight 0.005 --fast -e 52 --grid-spacing 160 --energy-weight 1e-1 --refine 2 --coarsest 8 --ic-weight 0 --output-intermediate --mi --accuracy 8 -o Registration/warp/RFP_Jun06A2GCDA_warp_m0g160c8e1e-1x52r2.list Registration/affine/RFP_Jun06A2GCDA_9dof.list
INFO: number of threads set to 4 according to environment variable CMTK_NUM_THREADS
Reading input studylist Registration/affine/RFP_Jun06A2GCDA_9dof.list
WARNING: image does not have valid orientation meta information; cannot reorient.
WARNING: image does not have valid orientation meta information; cannot reorient.[/color]



[color=#0000ff]I did not see any error message here, so I am very confused. [/color]

[color=#0000ff]Thanks for looking into my problems. Happy Holidays!
[/color]
Jan 6, 2018  05:01 PM | Torsten Rohlfing
RE: Warp output unreadable in reformatx
Hm. There doesn't seem to be anything obviously wrong here.

Another question would be, do the same cases consistently fail and succeed, respectively? That is, if you re-run a failed run with exactly the same command, would it (sometimes) then succeed?