Context. Large-scale vortices could play a key role in the evolution of protoplanetary disks, particularly in the dead-zone where no turbulence associated with magnetic field is expected. Their possible formation by the subcritical baroclinic instability is a complex issue because of the vertical structure of the disk and the elliptical instability. Aims. In 2D disks the baroclinic instability is studied as a function of the thermal transfer efficiency. In three-dimensional disks we explore the importance of radial and vertical stratification on the processes of vortex formation and amplification. Methods. Numerical simulations are performed using a fully compressible hydrodynamical code based on a second-order finite volume method. We assume a perfect gas law in inviscid disk models in which heat transfer is due to either relaxation or diffusion. Results. In 2D, the baroclinic instability with thermal relaxation leads to the formation of large-scale vortices, which are unstable with respect to the elliptic instability. In the presence of heat diffusion, hollow vortices are formed which evolve into vortical structures with a turbulent core. In 3D, the disk stratification is found to be unstable in a finite layer which can include the mid-plane or not. When the unstable layer contains the mid-plane, the 3D baroclinic instability with thermal relaxation is found to develop first in the unstable layer as in 2D, producing large-scale vortices. These vortices are then stretched out in the stable layer, creating long-lived columnar vortical structures extending through the width of the disk. They are also found to be the source of internal vortex layers that develop across the whole disk along baroclinic critical layer surfaces, and form new vortices in the upper region of the disk. Conclusions. In 3D disks, vortices can survive for a very long time if the production of vorticity by the baroclinic amplification balances the destruction of vorticity by the elliptical instability. However, this possibility is strongly dependent on the disk properties. Such baroclinic vortices could play a significant role in the global disk evolution and in participating to the decoupling of solids from the gas component. They could also contribute to the formation of new out-of-plane vortices by a critical layer excitation mechanism.