Great work, been running well for me until I ran into an issue today. I received the error code:
??? Subscript indices must either be real positive integers or logicals.
Error in ==> inpaintn>InitialGuess at 179
z(~I) = y(L(~I));
Error in ==> inpaintn at 142
[y,s0] = InitialGuess(x,isfinite(x));
Error in ==> test at 32
betas_paint2(:,k) = inpaintn(betas_paint(:,k));
Was trying to run inpaintn through an external loop feeding it vectors. It made it through the first 8 then gave me an error. Any help is appreciated.
This is a great program! It is easy to use, and is really impressively fast.
I was using it for 3D and 4D interpolation of rather large problems, and was taking hours per image to process. I found that I could offload much of the problem to the GPUs, and get an order of magnitude more speed with a couple of lines of extra code! It's a bit sloppy, but putting y = gpuArray(y) near the beginning of the cdtn() and icdtn() functions bought me this performance enhancement. There are likely more efficient and elegant ways of sending it to the GPU, though this way worked great in a pinch. Small problems (including the example problem) run a bit slower with this modification, so this really is for large problems only.
I'm incorrect. Apologies.
Although I had downloaded Damien's new version of inpaintn, I had earlier used the older version (that I had neglected to delete), in a folder that put it ahead of the new version.
The call to test4DCTNANDIDCTN can be eliminated because the functions dctn and idctn are now included in the inpaintn.m file.
Otherwise, works well. Results in my application compare reasonably with John D'Errico's inpaint_nans3, and is faster.