function  [Objects] = f_imageAnalysis(Label, chHoechst, chTH, chMap2, chSNCA, PreviewPath, MetaTable)
    %vol(chHoechst, 0, 10000)% Hoechst
    %vol(chMap2, 0, 50000)
    %vol(chTH, 0, 20000)
    %vol(chSNCA, 0,10000)
    
    if false % debug tool
        chHoechst = chHoechst(4000:5000,1000:4000,:);
        chMap2 = chMap2(4000:5000,1000:4000,:);
        chTH = chTH(4000:5000,1000:4000,:);
        chSNCA = chSNCA(4000:5000,1000:4000,:);
    end
  
    %% Segment Organoid
    chOrganoid = imlincomb(0.25, chHoechst, 0.25, chMap2, 0.25, chTH, 0.25, chSNCA); %vol(chOrganoid, 0, 10000)
    OrganoidMask = chOrganoid > 400;
    %%OrganoidMask = Iris_KeepbiggestObct3D(OrganoidMask);
    OrganoidMask = bwareaopen(OrganoidMask, 1e6);
    
    OrganoidMask = imclose(OrganoidMask, strel('disk', 50));
    OrganoidMask = imclose(OrganoidMask, strel('sphere', 5));
    OrganoidMask = logical(imfill(OrganoidMask, 'holes')); % vol(OrganoidMask,0,1)
    
    %%OrganoidMaskEroded = imerode(OrganoidMask, strel('disk', 250));
    %OrganoidMaskEroded = OrganoidMask; % for midbrain we do not filter out the organoid border
    %OrganoidMaskOuterRingCandidates = OrganoidMask & ~OrganoidMaskEroded; % imtool(max(OrganoidMaskOuterRingCandidates,[],3))
    %OrganoidMaskOuterRingObjects = regionprops('table', bwlabeln(OrganoidMaskOuterRingCandidates), {'Area', 'PixelIdxList'});
    %OrganoidMaskOuterRingObjects = OrganoidMaskOuterRingObjects(OrganoidMaskOuterRingObjects.Area > 5e6, :); % todo  > 1e7
    %OrganoidMaskOuterRing = f_Create_Mask_from_ObjectList_Pixel_IDX(OrganoidMaskOuterRingObjects, 'PixelIdxList', OrganoidMask); % imtool(max(OrganoidMaskOuterRing,[],3))
    %OrganoidMaskCurated = OrganoidMask & ~OrganoidMaskOuterRing;
    %% Segment Nuclei
    NucMask = medfilt3(chHoechst) > 600;
    NucMask = bwareaopen(NucMask, 50);
    %NucMask = NucMask & OrganoidMaskCurated; % vol(NucMask, 0,1)

    
    %% Segment Map2
    ObjectsThisOrganoid = table();
    %% Intensity  Map2
    % detect intermediate filamentous structures
    %for p=1:size(chMap2, 3)
    %chMap2_FT(:,:,p) = f_LPF_by_FFT_Semra(double(chMap2(:,:,p)), 'Butterworth', [7,1000], 0);
    %end % vol(uint16(chMap2_FT) * 1000, 0, 1000) % vol(chMap2_FT, 0, 10000)
    %chMap2_FT = uint16(mat2gray(chMap2_FT).*(2^16)-1); % vol(chMap2_FT, 17500, 17600) vol(chMap2_FT, 15000, 17600) % vol(chMap2_FT, 0, 20000)
    %chMap2FTMask = chMap2_FT > 18000; % vol(chMap2FTMask, 0,1)% 6500
    %chMap2FTMask = chMap2_FT > 15000; % vol(chMap2FTMask, 0,1)% 6500
    %Map2DoG = imfilter(chMap2, fspecial('gaussian', 105, 1) -  fspecial('gaussian', 105, 35), 'symmetric');
    %vol(Map2DoG, 0, 1000)% imtool(max(Map2DoG,[],3),[])
    %Map2DoGMask = Map2DoG > 500;
    %vol(Map2DoGMask, 0, 1) % imtool(max(Map2DoGMask,[],3),[])
    %chMap2FTMask = chMap2_FT > 250; % vol(chMap2_FT, 0,10000)% vol(chMap2FTMask, 0,1)% 6500
    %chMap2FTMask = chMap2_FT > 3000; % vol(chMap2_FT, 0,10000)% vol(chMap2FTMask, 0,1)% 6500
    %chMap2FTMask = chMap2_FT > 7000; % vol(chMap2_FT, 0,10000)% vol(chMap2FTMask, 0,1)% 6500
    %Map2MaskGlobal = chMap2 > 4500; % remove fft artefacts % vol(Map2MaskGlobal, 0,1)
    %Map2MaskGlobal = chMap2 > 250; % remove fft artefacts % vol(Map2MaskGlobal, 0,1)
    %Map2MaskBright = chMap2 > 60000; %vol(chMap2, 0, 60000); vol(Map2MaskBright, 0,1) % segment obvious bright structures
    %Map2Mask = (Map2MaskGlobal & chMap2FTMask) | Map2MaskBright;%vol(Map2Mask, 0,1)
    %Map2Mask = (Map2MaskGlobal & chMap2FTMask & Map2DoGMask) | Map2MaskBright;%vol(Map2Mask, 0,1)
    %Map2Mask = bwareaopen(Map2Mask, 50);
    %Map2Mask = bwareaopen(Map2Mask, 500);
    %Map2Mask = Map2Mask & OrganoidMaskCurated;% vol(Map2Mask, 0,1) % imtool(max(Map2Mask,[],3),[])
    
    %% Map2 & Tuj1 from Alise
    % detect large structures
    for p=1:size(chMap2, 3)
        Map2_FT(:,:,p) = f_LPF_by_FFT(chMap2(:,:,p), 'Butterworth', [15,1], 0);
    end % vol(chMap2_FT * 1000, 0, 100, hot)

    Map2Mask = Map2_FT > 0.07; % vol(Map2Mask)
    Map2Mask = bwareaopen(Map2Mask, 27);
    
    clear('Map2_FT')

    %% Segment TH
    
    for p=1:size(chTH, 3)
        TH_FT(:,:,p) = f_LPF_by_FFT(chTH(:,:,p), 'Butterworth', [15,1], 0);
    end % vol(TH_FT * 10000, 0, 1000, hot)

    THMask = TH_FT > 0.02;
    THMask = bwareaopen(THMask, 27);
    %THMask = TH_FT > 0.0200; % vol(THMask)
    %THMask = bwareaopen(THMask, 27); 
    
    %The bwareopen is to detect bigger or smaller structures, like in this case, the dotted pattern of the neurites.
    
    %THMask = THMask & OrganoidMaskCurated;
    THandMap2 =  THMask & Map2Mask; %vol(THandMap2)
    clear('TH_FT') 
    
    %% Segment SNCA
    
    for p=1:size(chSNCA, 3)
        SNCA_FT(:,:,p) = f_LPF_by_FFT(chSNCA(:,:,p), 'Butterworth', [15,1], 0);
    end % vol(SNCA_FT * 10000, 0, 1000, hot)

    SNCAMask = SNCA_FT > 0.030; % vol(SNCAMask)
    SNCAMask = bwareaopen(SNCAMask, 27);
    
    %SNCAMask = SNCAMask & OrganoidMaskCurated;
    clear('SNCA_FT') 
 
    %% Feature extraction
    Objects = table();
    Objects.OrganoidIdx = MetaTable.Idx;
    Objects.Well = MetaTable.Well;
    Objects.AreaName = MetaTable.AreaName;
    Objects.OrganoidID = MetaTable.OrganoidID;

    Objects.NucArea = sum(NucMask(:));
    Objects.Map2Area = sum(Map2Mask(:));
    Objects.THArea = sum(THMask(:));
    Objects.SNCAArea = sum(SNCAMask(:));
    Objects.Map2VoxelsByNucVoxels = Objects.Map2Area / Objects.NucArea;
    Objects.THVoxelsByNucVoxels = Objects.THArea / Objects.NucArea;
    Objects.THVoxelsByMap2Voxels = Objects.THArea / Objects.Map2Area; 
    Objects.SNCAVoxelsByNucVoxels = Objects.SNCAArea / Objects.NucArea;
    Objects.SNCAVoxelsByMap2Voxels = Objects.SNCAArea / Objects.Map2Area;
    Objects.SNCAVoxelsByTHVoxels = Objects.SNCAArea / Objects.THArea;
    %Objects.MeanSNCAIntensityInOrganoidVoxels = mean(chSNCA(OrganoidMask));
    Objects.MeanSNCAIntensityInNucVoxels = mean(chSNCA(NucMask));
    Objects.MeanSNCAIntensityInMap2Voxels = mean(chSNCA(Map2Mask));
    Objects.MeanSNCAIntensityInTHVoxels = mean(chSNCA(THMask));
    Objects.OrganoidVolume = sum(OrganoidMask(:));
    %Objects.OrganoidVolumeCurated = sum(OrganoidMaskCurated(:));
  
    %% Previews 
    % Scalebar
    imSize = [size(chHoechst, 1), size(chHoechst, 2)];
    [BarMask, BarCenter] = f_barMask(200, 0.32393102760889064, imSize, imSize(1)-200, 200, 25);
    %it(BarMask)

    RGB = cat(3, imadjust(max(chSNCA, [], 3), [0 0.3], [0 1]), round(0.5 * imadjust(max(chTH, [], 3), [0 1], [0 1])), imadjust(max(chHoechst, [], 3), [0 0.06], [0 1]));
    RGB = imoverlay2(RGB, BarMask, [1 1 1]);
    %imtool(RGB) % imtool(max(chTH, [], 3),[])
     
    %PreviewMap2 = imoverlay2(imadjust(max(chMap2,[],3), [0 0.5], [0 1]), bwperim(max(Map2Mask,[],3)), [1 0 0]);
    PreviewMap2 = f_imoverlayAlpha(imadjust(max(chMap2,[],3), [0 0.8], [0 1]), max(Map2Mask,[],3), [1 0 0], 0.1);
    %PreviewMap2 = imoverlay2(round(0.5*(imadjust(max(chMap2,[],3), [0 0.005], [0 1]))), max(Map2Mask,[],3), [1 0 0], 0.1);
    PreviewMap2 = imoverlay2(PreviewMap2, BarMask, [1 1 1]);
    %imtool(PreviewMap2,[])
    
    PreviewNuc = f_imoverlayAlpha(imadjust(max(chHoechst,[],3), [0 0.1], [0 1]), max(NucMask,[],3), [0 0 1], 0.1);
    PreviewNuc = imoverlay2(PreviewNuc, BarMask, [1 1 1]);
    %imtool(PreviewNuc,[])
    
    %PreviewTH = imoverlay2(imadjust(max(chTH,[],3), [0 0.2], [0 0.075]), bwperim(max(THMask,[],3)), [0 1 0]);
    %PreviewTH = imoverlay2(round(0.5*(imadjust(max(chTH,[],3), [0 0.75], [0 1]))), bwperim(max(THMask,[],3)), [0 1 0]);
    PreviewTH = imoverlay2(imadjust(max(chTH,[],3), [0 0.1], [0 1]), bwperim(max(THMask,[],3)), [0 1 0]);
    PreviewTH = imoverlay2(PreviewTH, BarMask, [1 1 1]);
    %imtool(PreviewTH,[])
    
    PreviewSNCA = imoverlay2(imadjust(max(chSNCA,[],3), [0 0.1], [0 1]), bwperim(max(SNCAMask,[],3)), [1 1 0]);
    PreviewSNCA = imoverlay2(PreviewSNCA, BarMask, [1 1 1]);
    %imtool(PreviewSNCA,[])
    
    PreviewOrganoid = f_imoverlayAlpha(imadjust(max(chSNCA,[],3), [0 0.2], [0 1]), max(OrganoidMask,[],3), [1 0 1], 0.05);
    PreviewOrganoid = imoverlay2(PreviewOrganoid, BarMask, [1 1 1]);
    %imtool(PreviewOrganoid,[])

    PreviewOrganoid = f_imoverlayAlpha(imadjust(max(chMap2,[],3), [0 0.2], [0 1]), max(OrganoidMask,[],3), [1 0 1], 0.05);
    PreviewOrganoid = f_imoverlayAlpha(PreviewOrganoid, max(OrganoidMask,[],3), [0 1 0], 0.05);
    %before OrganoidMaskCurated
    PreviewOrganoid = imoverlay2(PreviewOrganoid, BarMask, [1 1 1]);
    %imtool(PreviewOrganoid,[])

    %% Write Previews 
    IdentityString = ['PreviewOrganoid', '_', MetaTable.OrganoidID{:}];
    imwrite(RGB, [PreviewPath, filesep, IdentityString, '_RGB.png'])
    imwrite(PreviewMap2, [PreviewPath, filesep, IdentityString, '_Map2.png'])
    imwrite(PreviewNuc, [PreviewPath, filesep, IdentityString, '_Nuc.png'])
    imwrite(PreviewTH, [PreviewPath, filesep, IdentityString, '_TH.png'])
    imwrite(PreviewSNCA, [PreviewPath, filesep, IdentityString, '_SNCA.png'])
    imwrite(PreviewOrganoid, [PreviewPath, filesep, IdentityString, '_Organoid.png'])


end
