Groupwise registration is concerned with bringing a group of images into the best spatial alignment. If images in the group are from different modalities, then the intensity correspondences across the images can be modeled by the joint density function (JDF) of the cooccurring image intensities. We propose a so-called treecode registration method for groupwise alignment of multimodal images that uses a hierarchical intensity-space subdivision scheme through which an efficient yet sufficiently accurate estimation of the (high-dimensional) JDF based on the Parzen kernel method is computed. To simultaneously align a group of images, a gradient-based joint entropy minimization was employed that also uses the same hierarchical intensity-space subdivision scheme. If the Hilbert kernel is used for the JDF estimation, then the treecode method requires no data-dependent bandwidth selection and is thus fully automatic. The treecode method was compared with the ensemble clustering (EC) method on four different publicly available multimodal image data sets and on a synthetic monomodal image data set. The obtained results indicate that the treecode method has similar and, for two data sets, even superior performances compared to the EC method in terms of registration error and success rate. The obtained good registration performances can be mostly attributed to the sufficiently accurate estimation of the JDF, which is computed through the hierarchical intensity-space subdivision scheme, that captures all the important features needed to detect the correct intensity correspondences across a multimodal group of images undergoing registration.