I dont know why you'd do this in IDL :) but.... people are asking for it and if people are using it, let's improve it.
NOT GURANTEED TO WORK IN 3-D ... but it might ... developing ...
note that you should have this in your startup file so you can take advantage of multithreading of histogram on multicore machines: IDL_CPU_TPOOL_NTHREADS=your number here. It typically wont use this full number, maybe half of it, but it should still give a speed up.
Please notify me of any issues/errors via the issues feature in github. This way they can be documented for all to see.
Sadly, I'm probably not going to work on this code because it's in IDL. So if you'd like to manage improving this code, you can fork it and then manage the official branch. If this interest you, let me know.
This being github you are welcomed to fork it and improve it. Please devise formalized tests for it when possible. This will help me (or whomever is managing the project) understand what you did, that it works, and that it should be merged!
The code uses JD Smiths hist_nd at it's core. This can be found in David Fanning's coyote library along with the Coyote library procedure undefine.pro. Do yourself a favor and just get his entire library which can be found at http://www.idlcoyote.com/ along with his books you should buy and read. Then put it in your IDLPATH.
The code includes setdifference (A but not B) who's origin is lost in time.