Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New user of FAIR #12

Open
Hoda-GH opened this issue Mar 10, 2021 · 8 comments
Open

New user of FAIR #12

Hoda-GH opened this issue Mar 10, 2021 · 8 comments

Comments

@Hoda-GH
Copy link

Hoda-GH commented Mar 10, 2021

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!

@Hoda-GH
Copy link
Author

Hoda-GH commented Mar 11, 2021

Hi @lruthotto ,
I appreciate if you could take a look at this.
Thank you.

@lruthotto
Copy link
Contributor

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.

@Hoda-GH
Copy link
Author

Hoda-GH commented Mar 11, 2021

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?

@lruthotto
Copy link
Contributor

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.

@Hoda-GH
Copy link
Author

Hoda-GH commented Mar 12, 2021

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! #11 (comment)
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 ?

@zicongzhou818
Copy link

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);

@lruthotto
Copy link
Contributor

Can you try again after pulling the latest version? For some reason, it seems that this file got deleted. I've added it back.

@TimRoith
Copy link

TimRoith commented Apr 8, 2021

Great, 975edeb solves the issue I created #11.

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants