$graphicimage ) { if( isset($thistracks['indeximages'][$tracknum]) ) { $indeximage = $thistracks['indeximages'][$tracknum]; imagecopy( $outimg, $indeximage['image'], $maxtitlewidth, $thisheight, 0, 0, $indeximage['size'][0], $indeximage['size'][1] ); } $thistrackheight = $graphicimage['size'][1]; imagecopy( $outimg, $graphicimage['image'], $maxtitlewidth+$maxindexwidth, $thisheight, 0, 0, $graphicimage['size'][0], $graphicimage['size'][1] ); $thisheight += $thistrackheight; } $thisheight += $interspeciesmargin; $thiswidth = $maxtitlewidth + $maxindexwidth; foreach( $syntenies as $i => $synteny ) { $thisregionheight = $thisheight; $thisregionwidth = $width * abs( $synteny['to_end'] - $synteny['to_start'] ) / abs( $dispparam['end'] - $dispparam['start'] ); $thisregionleftonfrom = $maxtitlewidth + $maxindexwidth + $width * $synteny['from_start'] / abs( $dispparam['end'] - $dispparam['start'] ); foreach( $syntenictracks[$i]['graphicimages'] as $tracknum => $graphicimage ) { if( isset($syntenictracks[$i]['indeximages'][$tracknum]) ) { $indeximage = $syntenictracks[$i]['indeximages'][$tracknum]; imagecopy( $outimg, $indeximage['image'], $maxtitlewidth, $thisregionheight, 0, 0, $indeximage['size'][0], $indeximage['size'][1] ); } $thistrackheight = $graphicimage['size'][1]; imagecopy( $outimg, $graphicimage['image'], $thiswidth, $thisregionheight, 0, 0, $graphicimage['size'][0], $graphicimage['size'][1] ); $thisregionheight += $thistrackheight; } imageline( $outimg, $thisregionleftonfrom, $thisheight-$interspeciesmargin, $thiswidth, $thisheight, $penColor ); imageline( $outimg, $thisregionleftonfrom+$thisregionwidth, $thisheight-$interspeciesmargin, $thiswidth+$thisregionwidth, $thisheight, $penColor ); imageline( $outimg, $thisregionleftonfrom, 0, $thisregionleftonfrom, $thisheight-$interspeciesmargin, $penColor ); imageline( $outimg, $thisregionleftonfrom+$thisregionwidth, 0, $thisregionleftonfrom+$thisregionwidth, $thisheight-$interspeciesmargin, $penColor ); imageline( $outimg, $thiswidth, $thisheight, $thiswidth, $totalheight, $penColor ); imageline( $outimg, $thiswidth+$thisregionwidth, $thisheight, $thiswidth+$thisregionwidth, $totalheight, $penColor ); $thiswidth += $thisregionwidth + $intraspeciesmargin; } header( 'Content-Type: image/png' ); imagepng( $outimg ); ?>