| Author |
Topic  |
|
|
xu
Junior Member
 
25 Posts |
Posted - Sep 16 2008 : 11:15:20 AM
|
Hi all,
I have problem to use readmr, and I got error as following,
--------------------------------* >> cd U:\Pediatrics\FSE.01\Analysis\freesurfer\FSE0008\mri >> data1=readmr('T1.bxh') ??? Error using ==> readmr In an assignment A(:) = B, the number of elements in A and B must be the same. --------------------------------*
Could anyone tell me how to solve the problem?
Thanks in advance,
Amy
|
|
|
petty
BIAC Staff
    
USA
453 Posts |
Posted - Sep 16 2008 : 2:45:39 PM
|
this typically means that your bxh header is incorrect.
you'll want to verify that the information in the bxh actually reflects the image.
ie: are dimension, voxel sizes, file names correct? |
 |
|
|
syam.gadde
BIAC Staff
    
USA
421 Posts |
Posted - Sep 16 2008 : 2:53:24 PM
|
| I actually have access to that data, so I tried the same thing, and readmr works for me. Are you using the latest version of the BIAC MATLAB tools? You can find them in \\gall\programs\MATLAB\BIAC . They were last updated March 25, 2008. |
 |
|
|
xu
Junior Member
 
25 Posts |
Posted - Sep 17 2008 : 12:05:38 PM
|
Thanks Petty and Syam,
Actually, the readmr function works well in my office computer, but it had problem in Dr.Lewis’s home computer with same image files. He installed Matlab 7.1, and latest version of BIAC tools, any suggestion?
Thanks again,
Amy
|
 |
|
|
dvsmith
Advanced Member
    
USA
218 Posts |
Posted - Aug 18 2009 : 6:57:06 PM
|
Quick question about readmr:
Does it always fail to load an MR image if the image is composed of all 0s and a single 1? I have mask with a single voxel that readmr fails to load. It throws the following error:
??? Error using ==> readmr Can't read enough bytes in header for file L_S1_-34_-34_40.nii.gz!
The image loads fine in any other program. And, if increase to the size of the mask within the image, it will eventually load correctly. This problem seems to be limited to very small ROIs (< 10 voxels).
Thanks, David
|
 |
|
|
syam.gadde
BIAC Staff
    
USA
421 Posts |
Posted - Aug 18 2009 : 7:24:52 PM
|
| I'm sure this is a silly bug on my part. I will take a look. |
 |
|
|
dvsmith
Advanced Member
    
USA
218 Posts |
Posted - Aug 18 2009 : 7:53:01 PM
|
Thanks, Syam. I tried it with an older (3.1.4) and the newest version of the tools, and it didn't make a difference. Let me know if I can provide more details...
Cheers, David
|
 |
|
|
syam.gadde
BIAC Staff
    
USA
421 Posts |
Posted - Aug 19 2009 : 10:08:16 AM
|
readmr saves a copy of the image header in the structure it returns. However, it did not account for compressed images and so for very well compressed images that are smaller than the calculated header size (348 in the case of NIFTI files) it was trying to read too many bytes.
I have put a new copy of the function here:
http://ww.biac.duke.edu/home/gadde/readmr.m
Can you copy it, add to your path and see if it works? |
 |
|
|
dvsmith
Advanced Member
    
USA
218 Posts |
Posted - Aug 19 2009 : 10:28:28 AM
|
| can you check the link? even after adding the www instead of the ww, it's still broken. |
 |
|
|
syam.gadde
BIAC Staff
    
USA
421 Posts |
Posted - Aug 19 2009 : 11:38:44 AM
|
Maybe our web server restricts some files based on extension. I've put a copy on fatt here:
\\fatt\data\BIAC\Programs\User_Scripts\Gadde\readmr.m
|
 |
|
|
dvsmith
Advanced Member
    
USA
218 Posts |
Posted - Aug 19 2009 : 6:13:47 PM
|
success -- this version of readmr.m can handle the most extreme version of a mask (i.e., one with a single voxel).
thanks! |
 |
|
|
syam.gadde
BIAC Staff
    
USA
421 Posts |
Posted - Aug 20 2009 : 07:35:36 AM
|
| Great, thanks for testing. This will go into the next release. |
 |
|
|
dvsmith
Advanced Member
    
USA
218 Posts |
Posted - Jul 21 2011 : 2:15:03 PM
|
Hi Syam,
Maybe a potential bug in the readmr version on the cluster...
>> x = readmr('run1.bxh') x = data: [4-D double] info: [1x1 struct]
>> y = readmr('run1.nii.gz') ??? Error using ==> readmr at 2044 Error using ==> autodetectmr at 199 Undefined function or variable 'vers'.
I tried to make sure the java path was loaded, but it still threw the same error: >> javaaddpath /usr/local/packages/MATLAB/BIAC/java/ >> y = readmr('run1.nii.gz') ??? Error using ==> readmr at 2044 Error using ==> autodetectmr at 199 Undefined function or variable 'vers'. This does not happen on Mac, so it seems specific to the tools on the cluster.
Thanks! David
|
 |
|
|
petty
BIAC Staff
    
USA
453 Posts |
Posted - Jul 21 2011 : 2:38:53 PM
|
Ugg ... i thought i found all of those!
Basically, MATLAB removed some arguments from the function fileparts which is spread throughout the BIAC tools. I'll re-sync my local copy. |
 |
|
|
petty
BIAC Staff
    
USA
453 Posts |
Posted - Jul 21 2011 : 2:39:57 PM
|
| OK, try it again ... should work. If you see anything else with the 'vers' error, please let me know. |
 |
|
|
dvsmith
Advanced Member
    
USA
218 Posts |
Posted - Jul 21 2011 : 3:30:41 PM
|
| that seems to work. thanks! |
 |
|
| |
Topic  |
|