[Insight-users] Reading DICOM set and writing jpeg
Mathieu Malaterre
mathieu.malaterre at gmail.com
Tue Mar 24 10:53:25 EDT 2009
On Tue, Mar 24, 2009 at 2:16 PM, Eduardo - LNCC <camargo at lncc.br> wrote:
> Hi,
>
> I`m trying to read set of dicom files, extract one slice and write it in
> jpeg file. But the jpeg file is very strange, it appears in low resolution
> (or something like that).
> Could anybody help me? Sorry for my english
...
> RescalerType::Pointer rescaleFilter = RescalerType::New();
> rescaleFilter->SetOutputMinimum(0);
> rescaleFilter->SetOutputMaximum(255);
> rescaleFilter->SetInput( ExtractFilter->GetOutput() );
You are rescaling arbitrarily to [0,255] to create baseline JPEG 8bits
(lossy) image. You should instead inspect the histogram of pixel
values to get a better range. Or at least read the Window Center /
Window Width (0028,1050-1051) value to get an idea what is a correct
scalar range.
HTH
--
Mathieu
More information about the Insight-users
mailing list