A generalized multidimensional Wiener filter for denoising is adapted to hyperspectral images (HSIs). Commonly, multidimensional data filtering is based on data vectorization or matricization. Few new approaches have been proposed to deal with multidimensional data. Multidimensional Wiener filtering (MWF) is one of these techniques. It considers a multidimensional data set as a third-order tensor. It also relies on the separability between a signal subspace and a noise subspace. Using multilinear algebra, MWF needs to flatten the tensor. However, flattening is always orthogonally performed, which may not be adapted to data. In fact, as a Tucker-based filtering, MWF only considers the useful signal subspace. When the signal subspace and the noise subspace are very close, it is difficult to extract all the useful information. This may lead to artifacts and loss of spatial resolution in the restored HSI. Our proposed method estimates the relevant directions of tensor flattening that may not be parallel either to rows or columns. When rearranging data so that flattening can be performed in the estimated directions, the signal subspace dimension is reduced, and the signal-to-noise ratio is improved. We adapt the bidimensional straight-line detection algorithm that estimates the HSI main directions, which are used to flatten the HSI tensor. We also generalize the quadtree partitioning to tensors in order to adapt the filtering to the image discontinuities. Comparative studies with MWF, wavelet thresholding, and channel-by-channel Wiener filtering show that our algorithm provides better performance while restoring impaired HYDICE HSIs.