|
From: | adam aitkenhead |
Subject: | ind2rgb - Enabling handling of ND images |
Date: | Wed, 3 Apr 2013 09:14:59 +0000 |
Hi,
Currently ind2rgb can only handle 2D images. It'd be useful if it could handle ND images (3D and 4D images are quite common in medical applications), so I've attached a patch which enables this. The changes I've made are to ind2rgb.m and ind2x.m. This will bring ind2rgb more into line with Matlab's behaviour, as it can also handle ND images. In fact, Matlab's ind2rgb (for R2010a anyway, I don't know about later versions) only allows ND images to be handled if called with three outputs: [R,G,B] = ind2rgb(image,colormap); ...but I don't see any reason why it shouldn't also work with a single output: [R] = ind2rgb(image,colormap); ...so the attached patch works for ND arrays for both 1 and 3 outputs. (First time using Mercurial and the development build, so hopefully I've done everything relatively sensibly...) Adam |
ind2rgb_NDimages.diff
Description: Binary data
[Prev in Thread] | Current Thread | [Next in Thread] |