save interface as picture with 300 dpi

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

Forums:

Something like this:

print -r300 -dtiff -noui XXX.tif

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. 

You can edit the tiff with _300dpi suffix.

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. 

I think it's already high-res?

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)

Thanks a lot! That's very useful.