users > Reformatting error
Showing 1-7 of 7 posts
Display:
Results per page:
Oct 9, 2012  05:10 PM | Xiaojing Gao
Reformatting error
Hi,

Sorry it's my first time using cmtk, so the question may be primitive. I followed the user guide, and did the affine and warp registrations just fine. But when I ran reformatx, I got the following error:
reformatx: /build/buildd/cmtk-2.1.0/libs/Base/cmtkAnatomicalOrientationBase.cxx:92: static bool cmtk::AnatomicalOrientationBase::OnSameAxis(char, char): Assertion `(to=='A') || (to=='P') || (to=='L') || (to=='R') || (to=='I') || (to=='S')' failed.
My image is not a human brain, so I guess that error has something to do with the lack of a coordination system? Is there a way to get around it?

Xiaojing
Oct 9, 2012  08:10 PM | Torsten Rohlfing
RE: Reformatting error
Hi -

No such thing as a primitive question, especially if the software crashes ;)

Now, the first thing to try would be to update to a more recent version of CMTK - it seems you have 2.1.0, and that's a bit outdated.

If the current version still crashes, it would be good to know a bit more about your data. What image format are you using? What does your image header look like?

Ideally, if you could send me the two images and transformation file as well as the exact command line you are using, then that would be very helpful to track down the cause of this problem.

Thanks.
  Torsten
Oct 10, 2012  06:10 AM | Xiaojing Gao
RE: Reformatting error
Well, this is embarrassing: I tried several things, but could not get CMTK 2.2.4.
On my MacOSX, I downloaded the corresponding dmg, but I could not locate CMTK after running the installation package.
On my ubuntu, 2.1.0 was installed with apt-get. But when I ran the wrapper in CMTK-2.2.4-Linux-x86_64, I got the error:
/usr/lib/cmtk/bin/: No such file or directory. My system is i686, so I thought maybe it's not compatible with the CMTK-x86_64, but then I can't install from the source package with the configure-make-install routine.
Is there a dummy's instruction on how to install CMTK 2.2.4? I'll get back to the reformatting question once I get to test it... Thank you!
Oct 10, 2012  07:10 AM | Greg Jefferis
RE: Reformatting error
> Hi Xiaojing,

For the mac install, you should look in /opt/local/bin. If this is not in your path, then you will need to add it (in ~/.profile or equivalent).

Best,

Greg.
Oct 10, 2012  04:10 PM | Torsten Rohlfing
RE: Reformatting error
Hi Xiaojing:

Greg already pointed out that CMTK installs in /opt/local on OSX.

Regarding Ubuntu - if your OS is i686 (32bit) then you can indeed not run the 64bit (x86_64) CMTK. We no longer have a 32bit build system here, and no one ever seemed to download the binaries anyway, so I haven't been providing a 32bit Linux package for a while.

Building CMTK from source is quite straight forward:

- Download the CMTK source archive (from the same download page as the binary packages)
- Unpack archive using "tar -xzvf CMTK-2.2.4-Source.tar.gz"
- Make a build directory: "mkdir cmtk-build"
- "cd cmtk-build"
- Configure: "cmake ../cmtk-2.2.4/"
- Build: "make"

After that, you should have all binaries in cmtk-build/bin/, from whence you should be able to run them directly.
Oct 10, 2012  06:10 PM | Xiaojing Gao
RE: Reformatting error

Thank you guys, now the new version is running!

To Torsten:

However, I still got the same error message... My images are fly ventral nerve cords, and they are converted from lsm into PIC files.

My commands were:

make_initial_xform --principle-axes VNCIS1.PIC tilted01.PIC initial.xform

registration --initial initial.xform -dofs 6, 12 --auto-multi-levles 4 -o affine.xform VNCIS1.PIC tilted01.PIC

warp -o warp.xform --grid-spacing 40 --refine 3 --energy-weight 1e-1 --initial affine.xform VNCIS1.PIC tilted01.PIC

reformatx -o reformat.nii --floating tilted01.PIC VNCIS1.PIC warp.xform

The image files are ~100MB, do you have a preferred way to share them?

Xiaojing

Oct 10, 2012  08:10 PM | Torsten Rohlfing
RE: Reformatting error
Okay - I looked at your data, and here is what is happening:

- Your input images are confocal microscopies and as such do not live in one of the typical, medical (human) coordinate systems, e.g. "LPS" for DICOM.
- You are trying to reformat into a NIFTI file - but NIFTI requires that physical image coordinates are in RAS space.
- Since your input images have no valid anatomical coordinate space, conversion of the coordinate system to RAS fails

Coincidentally, you only saw the error you observed because you are using a Debug build - the Release build would have silently ignored the problem.

Now, I just checked a bug fix into the SVN repository, which will be part of the next CMTK release. This fix will issue a warning when your situation occurs, but will continue to write a NIFTI file (albeit one that violates the standard with respect to the meaning of its coordinates).

In the meantime, I strongly recommend for performance reasons that you compile MCTK in "Release" mode (run "ccmake ." in your build directory and set CMAKE_BUILD_TYPE to "Release").

Also, you should be able to write output in NRRD format (reformat.nrrd or reformat.nhdr) rather than NIFTI to avoid the problem - NRRD does not require any specific coordinate space, so CMTK will write without attemtping to change the coordinate system.

Hope this solves your problem.

Torsten