Ignore:
Timestamp:
Jun 22, 2016, 8:10:14 PM (8 years ago)
Author:
sommeria
Message:

various

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/merge_proj.m

    r955 r956  
    203203if min(cell2mat(CheckImage))==1 && (~Param.CheckObject || strcmp(Param.ProjObject.Type,'plane'))
    204204    FileExtOut='.png'; %image output (input and proj result = image)
    205     for iview=1:NbView
    206         BitDepth(iview)=FileInfo{iview}.BitDepth;
    207     end
    208     BitDepth=max(BitDepth);
    209205else
    210206    FileExtOut='.nc'; %netcdf output
     
    357353    %% recording the merged field
    358354    if strcmp(FileExtOut,'.png')    %output as image
    359         if BitDepth==8
    360             imwrite(uint8(MergeData.A),OutputFile,'BitDepth',8)
    361         else
    362             imwrite(uint16(MergeData.A),OutputFile,'BitDepth',16)
    363         end
    364355        if index==1
     356            if strcmp(class(MergeData.A),'uint8')
     357            BitDepth=8;
     358            else
     359              BitDepth=16; 
     360            end
    365361            %write xml calibration file, using the first file
    366362            siz=size(MergeData.A);
     
    391387            save(t,[fileparts(OutputFile) '.xml'])
    392388        end
    393        
     389        if BitDepth==8
     390            imwrite(uint8(MergeData.A),OutputFile,'BitDepth',8)
     391        else
     392            imwrite(uint16(MergeData.A),OutputFile,'BitDepth',16)
     393        end
    394394    else   %output as netcdf files
    395395        MergeData.ListGlobalAttribute={'Conventions','Project','InputFile_1','InputFile_end','NbCoord','NbDim'};
Note: See TracChangeset for help on using the changeset viewer.