Code Monkey home page Code Monkey logo

nordic_raw's People

Contributors

dowdlelt avatar remi-gau avatar steenmoeller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nordic_raw's Issues

format code to improve readability

Currently the logic of the code is hard to parse for a human because there is no systematic indentation applied to the code.

This could be very easily solved in MATLAB by simply running 'CTRL + A' and then 'CTRL + I' on the files in the repository.

Typo in variable name KKSP2 in NIFTI_NORDIC.m

KKSP2(:,:,slice,n)=KSP2(:,:,slice,n).*exp(-i*angle(meanphase(:,:,slice)));

Description:
I noticed a typo in the variable name KKSP2 in the NIFTI_NORDIC.m file. On line 288 of the file, KKSP2 is used, but it is not defined or used anywhere else in the code. It appears that this variable should actually be KSP2 based on its usage in other parts of the code.

I wanted to confirm if this typo could potentially cause any issues with the final processed data. If there are no other dependencies or calculations specifically related to KKSP2, it should be safe to replace it with KSP2 for consistency.

Steps to Reproduce:

Open the NIFTI_NORDIC.m file.
Go to line 288.

Expected Behavior:
The variable name KKSP2 should likely be KSP2 based on its usage in other parts of the code.

Issue with kernel_size_gfactor Option in NIFTI_NORDIC.m

I've come across an issue in the NIFTI_NORDIC.m file when using the kernel_size_gfactor option while ARG.use_magn_for_gfactor not provided. (default = 0)

The error appears to be related to an index issue in the following line of code:

KSP2=(KSP2(:,:,1:end,1:min(ARG.kernel_size_gfactor(4),end),1));

Although kernel_size_gfactor is considered a 3-valued array, the code at this line attempts to access the 4th element, causing the program to crash due to an index error.

I'm not entirely sure about the intent of this code segment. Looking at the commented out code, it previously used the 3rd element of the array, so I'm wondering if the current code is meant to take an optional 4-element array for kernal_size_gfactor when a phase image is being used?

I appreciate any insight you could provide on this matter. Thanks!

P.S: My colleagues and I are thrilled about NORDIC, and we intend to incorporate it into our animal fMRI preprocessing pipeline. In light of this, I've compiled NORDIC into a Python library using MATLAB Compiler SDK and updated my forked repository of this project on GitHub. As I understand the licensing terms, I realize the need for caution while sharing such derivative work. Therefore, I have made efforts to accurately state the license in the README.md document of my repository (https://github.com/dvm-shlee/nordic_cli). Could you please review my repository and verify whether my statements are in line with the licensing terms as stated in your repository?

Should there be any requirement for updates or changes, I would be grateful if you could inform me.

unknown function "sq"

I suspect this is a left over from aliasing squeeze into sq

The issue never appeared as this is part of some dead sub-function that never gets called: sub_create_NVR_file_HCP

$ cat NORDIC.m | grep sq\(

    Q=sq(abs(KSP2(end-3,3:end-3,:,end)));  Q1=mean(Q(:));  % take image noise from the bottom of the volume, where the signal is lowest - JIC
    Q=sq(abs(KSP2(end-3,3,:,:)));  Q1=mean(Q(:));  % take image noise from the bottom of the volume, where the signal is lowest - JIC
    Q=sq(abs(KSP_NOISE(:,:,:,end)));  Q11=mean(Q(:));
            Q=sq((KSP2(end-3,2,:,:)));  Q1a=mean(abs(Q(:)));  % take image noise from the bottom of the volume, where the signal is lowest - JIC
            Q=sq((KSP2(end-3,end-2,:,:)));  Q1b=mean(abs(Q(:)));  Q1=min(Q1a,Q1b);
            Q=sq((KSP_NOISE(:,:,:,end)));  Q11=mean(abs(Q(:)));
    Q=sq((KSP2(end-3,2,:,:)));  Q1a=mean(abs(Q(:)));  % take image noise from the bottom of the volume, where the signal is lowest - JIC
    Q=sq((KSP2(end-3,end-2,:,:)));  Q1b=mean(abs(Q(:)));  Q1=min(Q1a,Q1b);
    Q=sq((KSP_NOISE(:,:,:,end)));  Q11=mean(abs(Q(:)));    
    Q=sq((KSP2(end-3,2,:,:)));  Q1a=mean(abs(Q(:)));  % take image noise from the bottom of the volume, where the signal is lowest - JIC
    Q=sq((KSP2(end-3,end-2,:,:)));  Q1b=mean(abs(Q(:)));  Q1=min(Q1a,Q1b);
    Q=sq((KSP_NOISE(:,:,:,end)));  Q11=mean(abs(Q(:)));  
  

MATLAB version 2017 requires nifti tools

This should probably be mentioned in the README.

Tried on 2018a and loading nifti files could rely on MATLAB internal function, but on another computer with 2017a nifti could not be loaded.

NORDIC ERROR on few slices fMRI

Dear NORDIC developers,

I am trying to run NORDIC on fMRI data (BOLD and VASO). I tried a couple of protocols, and in one of them, I found the following error.

Index in position 3 is invalid. Array indices must be positive integers or logical values.

function --> subfunction_loop_for_NVR_avg_update

line 866--> KSP2_tmp=KSP2a(:,[1:w2]+(n2-1),[1:w3]+(n3-1),:);

Apparently in the second loop, w3 ==> (ARG.kernel_size(3)) change to a number that is bigger than my # slices (12 slices).

Do you know what I can do to fix that?

Best regards,

Ícaro Oliveira

Error in estimating gfactor map

Hi there,
Thank you for the work. I tried to run the NIFTI_NORDIC script with diff_MRI related magnitude and phase data, but I keep getting the sum(gfactor(:)) = 0 and therefore an incorrect estimation of the gfactor map. Could you help please?
Thank you

Unable to run DEMO: Undefined function or variable 'subfunction_loop_for_NVR_avg_update'

Hello,

I'm trying to run the DEMO as indicated in the README.md (also at the end of script_for_creating_simulation_data.m). However, when running NORDIC, I get the following error. Do you know what is happening?

Thanks very much
Cesar

NORDIC('demo_data_for_NORDIC.mat')
Using the NVR estimation method

PP =

   name: 'demo_data_for_NORDIC.mat'
   date: '10-Sep-2021 15:54:45'
  bytes: 204721995
  isdir: 0
datenum: 7.3841e+05

kernel_size =

 8     8     8

CHECK if the right input to NORDIC is used
change the scaling to the recon program

ans =

0.4117    0.4020

I am master, I have control
1 Undefined function or variable 'subfunction_loop_for_NVR_avg_update'.

Error in NORDIC>sub_NVR_for_one_slice (line 535)
subfunction_loop_for_NVR_avg_update(KSP2a,ARG.kernel_size(3),ARG.kernel_size(2),ARG.kernel_size(1),lambda,1,ARG.soft_thrs,KSP2_weight_tmp,ARG,NOISE_tmp,Component_threshold_tmp,energy_removed_tmp);

Error in NORDIC>NVR_LLR_3D_MP_2 (line 253)
[KSP_recon,~,KSP_weight,NOISE,Component_threshold,energy_removed]=sub_NVR_for_one_slice(KSP_recon,KSP2,ARG,n1,QQ,master_fast,KSP_weight,NOISE,Component_threshold,energy_removed)
; % save all files

Error in NORDIC (line 23)
NVR_LLR_3D_MP_2(DIR,file_filter,file_idx,NORDIC_threshold,DUAL,kernel_size,patch_avg,['kernel_' num2str(ker)],restart_list, master_fast,soft_thrs,
patch_avg_sub);

function or variable sq in DEMO commands

Hello Steen,
I'm trying to run the DEMO commands as follows, but got an error with the sq function. What's the function or variable sq?
It might be possible that I am using a very old matlab version, but I could not find any function in Mathworks online help.
Thanks very much,
Cesar

script_for_creating_simulation_data
NORDIC('demo_data_for_NORDIC.mat')

QQ=load('KSP_demo_data_for_NORDICkernel8')
Q=load('demo_data_for_NORDIC')
figure; clf
subplot(2,2,1); imagesc(sq(real(Q.KSP(:,:,32,12))),[0 1]); title('Data + noise')
subplot(2,2,2); imagesc(sq(real(Q.IMG(:,:,32,12))),[0 1]); title('Data w/o noise')
subplot(2,2,3); imagesc(sq(real(QQ.KSP_update(:,:,32,12))),[0 1]); title('NORDIC processed')
subplot(2,2,4); plot(sq(real(Q.KSP(20,25,32,1:end-2) - Q.IMG(20,25,32,1:end-1)))), hold on
plot(sq(real(QQ.KSP_update(20,25,32,1:end) - Q.IMG(20,25,32,1:end-1))))
legend('difference before NORDIC','difference after NORDIC')

Undefined function 'sq' for input arguments of type 'double'.

probable typos

probable typos detected using codespell

$ codespell

./NORDIC.m:7: auxilary ==> auxiliary
./NORDIC.m:7: shoudl ==> should
./NORDIC.m:7: shoudl ==> should
./NORDIC.m:17: shoudl ==> should
./NORDIC.m:19: Paramter ==> Parameter
./NORDIC.m:35: allready ==> already, all ready
./NORDIC.m:110: Usefull ==> Useful
./NORDIC.m:305: allready ==> already, all ready
./NORDIC.m:318: detrmine ==> determine
./NORDIC.m:771: MEMEORY ==> MEMORY
./README.md:16: paramters ==> parameters
./README.md:16: algortimic ==> algorithmic
./README.md:18: neccesary ==> necessary
./README.md:20: evaulation ==> evaluation
./README.md:56: neccesary ==> necessary
./NIFTI_NORDIC.m:23: specifiec ==> specific
./NIFTI_NORDIC.m:36: defautl ==> default
./NIFTI_NORDIC.m:38: temproal ==> temporal
./NIFTI_NORDIC.m:42: additonal ==> additional
./NIFTI_NORDIC.m:42: degress ==> degrees, digress
./NIFTI_NORDIC.m:49: Specifiec ==> Specific
./NIFTI_NORDIC.m:179: Serach ==> Search
./NIFTI_NORDIC.m:293: Standarad ==> Standard

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.