RSCH-RT / ImageJ_Macros

1 stars 0 forks source link

Scaling of pixel values may change #24

Closed mbolt01 closed 7 years ago

mbolt01 commented 7 years ago

When performing asym analysis on LA6 on 23/3/17 it was noted that images on one half of the panel had pixel values of approx 2 x that of the other half. This was determined to be due to the maximum pixel values within a 16-bit image being exceeded on one half of the panel and so pixel values are scaled during acquisition. Gafchromic was used to verify everything was correct as well as producing plans with 40/60MU instead of the usual 50MU.

mbolt01 commented 7 years ago

To fix this the pixel values can be converted to CU values using the scaling factor present in the DICOM files. (Should also probably check the intercept is zero to ensure it is only a scaling factor required) To avoid issues with only integer pixel values the image requires converting to 32-bit before scaling the values. This macro produces the desired result: https://gist.github.com/mbolt01/13ae258a11205c8f0fa6709d8dcfe403 (Might be nice if also could set it to show 'CU' in the display, but not required for use.

This seems to work, however due to image inversion the CU value displayed on combined image is incorrect. Inverting again solves this. Possibly the analysis could be flipped around so we can work with CU values?

mbolt01 commented 7 years ago

Might be possible to simplify the adding of images into 2 lines of code. 1 - Combine the 4 images into a stack (Image>Stacks>Images to Stack) 2 - Merge the stack of images to single image by summing them together. (Image>Stacks><ZProject... Sum slices)

This is not necessary as the current method already works and would produce the same end result.

mbolt01 commented 7 years ago

A tested image from LA4 had an intercept value which was non-zero, and the slope is negative. To make robust for all DICOM images, both the slope and intercept should be obtained and used.

mbolt01 commented 7 years ago

The pixel scaling is fixed by applying 'image math' using multiplication and addition separately. (see separate code branch for the change.)

Note: current analysis uses an inverted image for its testing. This means that CU values are not displayed to the user even after applying the scaling. To fix this the analysis should be changed so that it works correctly with a 'non-inverted' image.

mbolt01 commented 7 years ago

JP working on this and currently testing. Analysis function was changed (now should not depend upon image inversion). LA3/4 0.4% dif likely due to background now correctly accounted for with CU scaling. Version number of all macros will need increasing.

mbolt01 commented 7 years ago

CU scaling of Asym images fixed in pull request #26