save interface as picture with 300 dpi

Submitted by David on

Hi,

at the moment, the coronal, sagittal and transversal images are not written in 300 dpi when saving them.  Where can I adjust the script such that I can change the dpi of the images to 300 dpi? 

 

thank you,

 

David

But how to change the code, such that when I use the option "save interface as Picture" in DPABI Viewer, the coronal, sagittal and transversal images will be saved with a higher dpi? At the moment this is not the case but most journals want at least 300 dpi pictures. 

Thank you, 

I think I found the right line 1460-1462 in DPABI_VIEW.m:

imwrite(TData.cdata, fullfile(Path, [TName, Ext]));
        imwrite(CData.cdata, fullfile(Path, [CName, Ext]));
        imwrite(SData.cdata, fullfile(Path, [SName, Ext]));

Here, imwrite is used instead of print, so the dpi can not be changed. 

Sorry for the late reply. 

No, imwrite writes the image in the resolution that is specified in the data matrix (see: https://stackoverflow.com/questions/17211048/matlab-imwrite-quality), while print saves the current figure at some specified dpi.

I used the following work around based on the export_fig function (https://de.mathworks.com/matlabcentral/fileexchange/23629-export_fig)

 

%imwrite(TData.cdata, fullfile(Path, [TName, Ext]));
        h=figure;imshow(TData.cdata)
        set(0, 'CurrentFigure', h)
        export_fig(fullfile(Path, [TName, Ext]),'-dtiff','-r300')
        close(h)
        %imwrite(CData.cdata, fullfile(Path, [CName, Ext]));
        h=figure;imshow(CData.cdata)
        set(0, 'CurrentFigure', h)
        export_fig(fullfile(Path, [CName, Ext]),'-dtiff','-r300')
        close(h)
        %imwrite(SData.cdata, fullfile(Path, [SName, Ext]));
        h=figure;imshow(SData.cdata)
        set(0, 'CurrentFigure', h)
        export_fig(fullfile(Path, [SName, Ext]),'-dtiff','-r300')
        close(h)