Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function UpdatePlots(app)
- % Fenstereinstellungen
- W = app.EditFieldWW.Value;
- C = app.EditFieldWC.Value;
- %Slider to show current Picture
- sliderValueT = app.SliderTransversal.Value;
- sliderValueS = app.SliderSagittal.Value;
- sliderValueF = app.SliderFrontal.Value;
- %Pixel to Hounsfield
- rescaleIntercept=app.MetaData.RescaleIntercept;
- rescaleSlope =app.MetaData.RescaleSlope;
- %Limits
- lowLimit =rescaleSlope*(C-W/2) + abs(rescaleIntercept);
- highLimit=rescaleSlope*(C+W/2) + abs(rescaleIntercept);
- width = app.MetaData.Columns;
- height = app.MetaData.Rows;
- imageSize= size(app.Images,3); %Dritte Spalte in Matrix
- %Pixelspacing Vektor2d
- thickness= app.MetaData.SliceThickness;
- spacingX = app.MetaData.PixelSpacing(1);
- spacingY = app.MetaData.PixelSpacing(2);
- %Neuer Pixelabstand
- rx = thickness/spacingX;
- ry = thickness/spacingY;
- %Drehstreckungstransformation
- transform = affine2d([rx* cosd(90) ry*sind(90) 0;...
- sind(90) ry*cosd(90) 0;...
- 0 0 1]);
- %***********Transversale Schicht*******************************************/
- imgTransversal = app.Images(:,:,round(sliderValueT));
- imshow(imgTransversal,[lowLimit highLimit],'Parent',app.UITransversal);
- %***********Sagittale Schicht*******************************************/
- imgSagittal = app.Images(:, round(sliderValueS),:);
- sagittal = reshape(imgSagittal,[width imageSize]);
- sagittalTransformation = imwarp(sagittal, transform);
- imshow(sagittalTransformation,[lowLimit highLimit],'Parent',app.UISagittal);
- %***********Frontale Schicht******************************************/
- imgFrontal = app.Images(round(sliderValueF),:,:);
- frontal = reshape(imgFrontal,[height imageSize]);
- frontalTransformation = imwarp(frontal, transform);
- imshow(frontalTransformation,[lowLimit highLimit],'Parent', app.UIFrontal);
- end%*****************************************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement