Hello,
There is a tool for exporting to an IDL variable. On the following link, go to the section labeled "Export to IDL Variable" to see a description of how to do this.
http://www.exelisvis.com/...anageRasterData.html
Alternatively, you could use the ENVI API to open the raster in IDL and there you can directly make an IDL array which is the appropriate size to contain your values. (
http://www.exelisvis.com/...aster__GetData.html) In either case, the output arrays will need to be rectangular and cannot exactly fit your masked data if it is an odd shape.