Applying a 2D band pass filter (Butterworth ?) to an array with NaNs
filtfilt() is a technique to achieve zero-phase filtering by applying the same filter twice to the data; with the output of the first stage reversed and filtered again in the second stage. Zero phase filtering is a desired property in image processing. 
NaN means "not a number" and indicates those indeterminate conditions like $0/0$, $\infty/\infty$, $\infty - \infty$. NaNs cannot be processed arithmetically, hence you should remove all the NaN samples with some suitable values before further processing.