Duke-UNC Brain Imaging and Analysis Center
BIAC Forums | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password   Forgot your Password?
 All Forums
 Support Forums
 BXH Header Support
 bxh2analyze with SPM2
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ken.roberts
Junior Member

26 Posts

Posted - Jul 09 2003 :  7:33:54 PM  Show Profile  Reply with Quote
Hello,

The BXH tools have been working really well, but there is one small thing that prevents them from working easily with SPM2. The analyze header has several entries describing the dimensions of the file in the x, y, z, and t dimensions. Currently, for a single volume, (like a structural volume) the t field is filled in as having dimension 0 rather than 1. This causes problems when trying to open a file in SPM2. The workaround Ive used for the time being is here, but it is.


fid = fopen('V0001.hdr', 'r');
buf = fread(fid, 174, 'int16');
fclose(fid);

buf(25) = 1;
delete('V0001.hdr');

fid = fopen('V0001.hdr', 'w');
fwrite(fid, buf, 'int16');
fclose(fid);


Could this be fixed in the BXH utilities?

Ken

Woldorff Lab
Center for Cognitive Neuroscience
(919) 668-1334

syam.gadde
BIAC Staff

USA
421 Posts

Posted - Jul 10 2003 :  08:12:33 AM  Show Profile  Reply with Quote
Hello Ken,

I believe I have fixed this -- there indeed was an errant
setting of dimension size to 0 rather than 1. I have also
fixed the dimension sizes in the BXH headers that are optionally
output with the Analyze headers. Can you try it again and see
if the output seems reasonable?

Thanks,

-syam
Go to Top of Page

ken.roberts
Junior Member

26 Posts

Posted - Jul 10 2003 :  2:57:08 PM  Show Profile  Reply with Quote
It works fine now, and where SPM2 is concerned, as far as I can all of the fields are set correctly, or are filled in with correct values by the program automatically. Thank you!

Ken

Woldorff Lab
Center for Cognitive Neuroscience
(919) 668-1334
Go to Top of Page

ken.roberts
Junior Member

26 Posts

Posted - Jul 14 2003 :  5:23:17 PM  Show Profile  Reply with Quote
Hi,

I am in the process of making a couple of scripts that do the spm2 preprocessing and that gather as much information as possible about the data from the BXH files. In our experiment, two acquisitions taken at the same slice prescription have different (but equivalent) parameters. In the functional series along the z dimension, the node like this:


- <dimension type="z">
  <units>mm</units> 
  <size>28</size> 
  <origin>59.3474</origin> 
  <gap>0</gap> 
  <spacing>-3.8</spacing> 
  <direction>-0 0.106258 0.994339</direction> 
  </dimension>


Using bxh2analyze, the spacing fields were entered in as the voxel dimensions in the Analyze header. Now, in this example, the spacing field is negative, which has the effect of flipping the images upside down within spm2. It might make more sense to keep all of the spacings positive, and preserve the orientation by making the final entry in the direction vector negative (resulting in the same values in the anatomical BXH file). That way, there would not be any ambiguity introduced by a conversion program that did not use the direction vector, and since no orientation information was used, we could continue to assume that the image was in the default RAS orientation used by the SIGNA platform.

Ken

Woldorff Lab
Center for Cognitive Neuroscience
(919) 668-1334
Go to Top of Page

syam.gadde
BIAC Staff

USA
421 Posts

Posted - Jul 15 2003 :  10:44:21 AM  Show Profile  Reply with Quote
There was a problem with the bxhabsorb program in dealing with axial images (as it seems this is), which has since been fixed. The daemon was only recently updated to use this version, so anything scanned more than two weeks ago may exhibit this problem. Assuming this is a functional scan, can you try recreating the BXH file as follows:

  bxhabsorb pfileheader reconedvolumes... tmp.bxh

and see if the resulting BXH file is correct?

If it doesn't work, or if it was not a functional scan to start with, can you send me the original BXH file by email? Thanks!
Go to Top of Page

jsmith
BIAC Alum

USA
6 Posts

Posted - Sep 19 2003 :  2:07:48 PM  Show Profile  Reply with Quote
Hello,

I'm trying to use bxh2analyze to create header files for spm2 to run off of, and I'm wondering if there's a way to get bxh2analyze to suppress writing out the V*.img files, so it just writes out the Analyze header and the .mat file. It seems to me that it is simply reproducing the original V*.imgs files. If it's not, could someone tell me how the two sets of .img files are different?

The problem I have with writing out the V*.img's is that it seems if you run bxh2analyze on a bxh in the the "func/run" directory containing the original images, while specifying the same directory as the outpath, unless you provide some novel name to prepend to the output files (ie something other than V), bxh2analyze tries to overwrite the original V.img's and crashes, while simultaneously reducing at least the first original V.img it runs on to a size of 0 bytes.

Thanks!

Jon
Go to Top of Page

syam.gadde
BIAC Staff

USA
421 Posts

Posted - Sep 26 2003 :  3:26:38 PM  Show Profile  Reply with Quote
I have updated bxh2analyze with options to suppress the
writing of any or all of the .hdr, .img, .mat, and .bxh
files. It will also now exit gracefully if any file
it intends to write already exists.

I have also pushed out several updates to the other BXH
programs. Let me know if you encounter any problems!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
BIAC Forums © 2000-2010 Brain Imaging and Analysis Center Go To Top Of Page
This page was generated in 0.49 seconds. Snitz Forums 2000