IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
I get this error when trying to convert a DCM file:
IMAGICK: no decode delegate for this image format `J2K' @ error/constitute.c/ReadImage/501
Usually I would install imagemagick with sudo apt-get etc...but after some searching on this forum, I tried installing openjpg 2, and then installing ImageMagick-7.0.5-2 from source
I am not an expert on this, but you need to have openjpeg 2.1.0 or higher installed. I do not think you need --with jp2, which may refer to the older Jasper delegate which is no longer used by Imagemagick. Check your config.log to see if it got installed without error.
If you install from source, then you need to install all your needed delegates before installing Imagemagick, such as for TIFF, PNG, JPEG, Freetype, Fontconfig, zlib, Ghostscript, etc. Each of these may need other delegates installed before them.
So you probably got the error message because IM does not have the proper delegates installed.