FAIR.m
FAIR.m copied to clipboard
New user of FAIR
Hi,
I want to do rigid registration for 3D MRI and 3D CT of pelvis for the same patient using "Normalized Gradient Field". From the ebook on FAIR the links to tutorials don't work. Should I choose parts of the codes for sampling, interpolation etc from the ebook to run for my images or are these already implemented ?
I tried examples in Matlab, first I ran FAIRstartup.m and then E7_basic.m or E9_PETCT_MLIR_NGF_mbCurv.m but I get the same error as following:
Unrecognized function or variable 'getCellCenteredGrid'.
Error in jpgs2data>@(k)getCellCenteredGrid(omegaI(k),m) (line 64) xc = @(k) getCellCenteredGrid(omegaI(k),m);
Error in jpgs2data>@(I,k)viewImage(imgModel(I,omegaI(k),xc(k)),omegaI(k),m) (line 66) viewData = @(I,k) viewImage(imgModel(I,omegaI(k),xc(k)),omegaI(k),m);
Error in jpgs2data (line 69) subplot(1,2,1); viewData(dataT,1); title('template');
Error in setup2DPETCTData (line 25) expfile = jpgs2data('','PET-CT-PET.jpg','PET-CT-CT.jpg', ...
can someone help me please!
Hi @lruthotto , I appreciate if you could take a look at this. Thank you.
I cannot reproduce this issue. It seems like there is a problem with the MATLAB path. Could you verify that the kernel folder and its subfolders are in the path? A quick test could be do call
getCellCenteredGrid
This should print some documentation.
Thanks very much for your reply. I wrote getCellCenteredGrid in the command window and I get: Unrecognized function or variable 'getCellCenteredGrid'.
but I copy pasted the github_repo folder into Current Folder of Matlab then right clicked on the folder, clicked on Add to path and finally selected folders and subfolders.
I'm sorry this might be very simple but Is there anything else that I need to do?
OK, this error message also suggests that there is an issue with your matlab path.
If FAIR is your current folder you could try
addpath(genpath(pwd))
and then call getCellCenteredGrid again. If this does not work, I'd consider talking to Mathworks' customer service.
I tried another pc with matlab and I get the same error. So I manually added the folder that I downloaded from GitHub in "set Path" of Matlab. Would you confirm that in which one of the files "getCellCenteredGrid" is defined so that I can check if it's missing or not? another issue is open saying that getCellCenteredGrid.m is missing! https://github.com/C4IR/FAIR.m/issues/11#issue-756214442 What would one do to setup FAIR at the beginning? is there any specific file that I have to run so that matlab knows about FAIR? should I change anything in FAIRstartup.m file ?
It seems to be a file missing issue. The same problem comes up after I run testNumerics.m in the path "...\FAIR.m-master\kernel\numerics". This prints in the commands window:
testNumerics %============================================================================== % This code is part of the Matlab-based toolbox % FAIR - Flexible Algorithms for Image Registration. % For details see % - https://github.com/C4IR and % - http://www.siam.org/books/fa06/ %============================================================================== % This is a testing environment for the files in the folder kernel/numerics % 1. Based on data/contents, a list of required files is generated and it % is verified, that all files are present; additional files are listed. % 2. All c-files are compiled. % 3. All files are executed. %==============================================================================
FAIRcheckFiles(mfilename);
FAIRtestStatus =
struct with fields:
FAIRedit: 'off'
FAIRcompile: 'on'
FAIRrun: 'on'
FAIRclearTemp: 'off'
caller: 'testNumerics'
folder: 'F:\Codes\FAIR.m-master\FAIR.m-master\kernel\numerics'
testExamples: [1×147 struct]
testViewer: [1×20 struct]
========== [ FAIRcheckFolder ] ============================================= checks on [F:\Codes\FAIR.m-master\FAIR.m-master\kernel\numerics]
folder <F:\Codes\FAIR.m-master\FAIR.m-master\kernel\numerics> 26-of-27 files contained folder <F:\Codes\FAIR.m-master\FAIR.m-master\kernel\numerics> 1-of-27 files missing folder <F:\Codes\FAIR.m-master\FAIR.m-master\kernel\numerics> 1 missing files
- 1-of 1 missing getCellCenteredGrid.m
Error using FAIRcheckFolder (line 88) folder <F:\Codes\FAIR.m-master\FAIR.m-master\kernel\numerics> 1 missing files
Error in FAIRcheckFiles (line 35) FAIRtestStatus.(caller) = FAIRcheckFolder(FAIRtestStatus.('folder'));
Error in testNumerics (line 15) FAIRcheckFiles(mfilename);
Can you try again after pulling the latest version? For some reason, it seems that this file got deleted. I've added it back.
Great, 975edebd37b833ae76696792870de5c05efcb9cb solves the issue I created #11.
Thanks a lot!