layerfMRI/LAYNII

LN_LAYER_SMOOTH not detecting layers

Opened this issue · 6 comments

Hi there, I am currently attempting to do within-layer smoothing using LN_LAYER_SMOOTH with the NoKissing flag (LayNii v2.5.2 for M1/M2 mac). However when I run the below code with these files:

LN_LAYER_SMOOTH -input func.nii.gz -layer_file layers.nii.gz -FWHM 1 -NoKissing -output LN1_nokissing.nii.gz
...the output states "There are 0 layers/masks to smooth within".

When I run the same code with LN2_LAYER_SMOOTH, the 3 layers are recognised, but for some reason the first volume becomes 0 at all points (see LN2_nokissing.nii.gz). This issue doesn't occur when I use the LN2 version without the NoKissing flag though (LN2_yeskissing.nii.gz).

Any help would be greatly appreciated, thank you!

Thanks for reporting this @joshjcorbett.
could you share the input images func.nii.gz layers.nii.gz?
This would help me to look into it more specifically. Thanks.

Oh I see there is a link to the data, please never mind. I am on it.

Hi @joshjcorbett.

Sorry for getting back to you so late. and sorry about these issues.
I had a look into it and it looks to me like there are two issues.

  1. ) your layer file was in data type float64. In the days when LN_LAYER_SMOOTH was written, it was not anticipated that someone would need 64 bits for layers. One option is to adjust the file time, for example with LN_FLOAT_ME. Alternatively, you can also use the new and updated version of LN_LAYER_SMOOTH, which also supports layer files with data type float64.

2.) in the case of the no-kissing option, the program was not having the loop across TRs. I think it had been intended that the smoothing is usually only applied in upsampled space on final activity maps.
The new version of LN_LAYER_SMOOTH has this ability now to also run across TRs.

The Program LN2_LAYER_SMOOTH has never been intended for time series to begin with. I think it had never been tested either. I think it had been originally intended for faster performance and more readable code structure. However, it has never become the default program for smoothing. I think we still keep it in the repository because at some point in the future, we want make it usable. At some point, we want to test it across application cases and deprecate the LN_LAYER_SMOOTH. However, we are not there yet. Thus, I would not recommend anyone to use LN2_LAYER_SMOOTH at this time. Unless @ofgulban recommends something differently.

It will take a while until the next release that included the updated version of LN_LAYER_SMOOTH.
Until then the binaries for M1/M2 mac of the updated LN_LAYER_SMOOTH are attached.
LN_LAYER_SMOOTH.zip you might need to place it to the location of your binaries and give it executable permissions.

That's great, thank you so much for your help!!

If there is time I might iterate LN2_LAYER_SMOOTH to become the well tested successor of LN_LAYER_SMOOTH, however this is not high priority right now. I actually forgot why I/we needed LN2_LAYER_SMOOTH, looking at the source code it does seem unfinished. We might even consider dropping it from the build list for now. What do you think @layerfMRI? I don't think many people use this one.

I had a closer look at LN2_LAYER_SMOOTH now too. I think I had been confused it with the iterative smoothing.
I think there is not much missing to make it the proper successor of LN_LAYER_SMOOTH. The only thing missing that I could see is to make it work for 4D data. This might be doable at the inner most loop. So that it does not estimate the same smoothing kernel for each TR over and over again.
Since there is something that works for me via LN_LAYER_SMOOTH, its not really high on my priority list either.
I think that there are more than a hand full of people who use LN_LAYER_SMOOTH. And layer-smoothing is one of the main topics that are often mentioned in layer-fMRI events.
I don't know anyone who is using: LN2_LAYER_SMOOTH. But I do not see a big issue leaving it in.