[ome-users] Re: Matlab PixelSlice conversion problem

Anh Vu anh.q.vu at gmail.com
Fri Aug 19 22:40:02 BST 2005


Here are the three files I have for the execution chain NewTest, which
is the same as the matlabtest.m file I had earlier.

newtest.m:
-----------------------------------
function [output] = newtest(input)
output = input;

NewTest.ome:
----------------------------------
<?xml version="1.0" encoding="utf-8"?>

<OME xmlns="http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:AML="http://www.openmicroscopy.org/XMLschemas/AnalysisModule/RC1/AnalysisModule.xsd"
xmlns:STD="http://www.openmicroscopy.org/XMLschemas/STD/RC2/STD.xsd"
xsi:schemaLocation="http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd
http://www.openmicroscopy.org/XMLschemas/OME/FC/ome.xsd
http://www.openmicroscopy.org/XMLschemas/AnalysisModule/RC1/AnalysisModule.xsd
http://www.openmicroscopy.org/XMLschemas/AnalysisModule/RC1/AnalysisModule.xsd
http://www.openmicroscopy.org/XMLschemas/STD/RC2/STD.xsd
http://www.openmicroscopy.org/XMLschemas/STD/RC2/STD.xsd">
	<SemanticTypeDefinitions
xmlns="http://www.openmicroscopy.org/XMLschemas/STD/RC2/STD.xsd"
xsi:schemaLocation="http://www.openmicroscopy.org/XMLschemas/STD/RC2/STD.xsd
http://www.openmicroscopy.org/XMLschemas/STD/RC2/STD.xsd">
	</SemanticTypeDefinitions>	
	
	<AML:AnalysisModuleLibrary
xmlns="http://www.openmicroscopy.org/XMLschemas/AnalysisModule/RC1/AnalysisModule.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.openmicroscopy.org/XMLschemas/AnalysisModule/RC1/AnalysisModule.xsd
http://www.openmicroscopy.org/XMLschemas/AnalysisModule/RC1/AnalysisModule.xsd">
		<AnalysisModule
		   ModuleName="New Test"
		   Category="Test"
		   ModuleType="OME::Analysis::Handlers::MatlabHandler"
		   ProgramID="newtest"
		   ID="urn:lsid:openmicroscopy.org:Module:9123">
		  <Description>
		   Test the image input and output
		  </Description>
		  <Declaration>
			<FormalInput  Name="Pixels Slice"  SemanticTypeName="PixelsSlice" Count="!"/>

			<FormalOutput Name="Pixels Slice" SemanticTypeName="PixelsSlice" Count="!"/>
		  </Declaration>
		
		  <ExecutionInstructions ExecutionGranularity="I"
xmlns="http://www.openmicroscopy.org/XMLschemas/MLI/IR2/MLI.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.openmicroscopy.org/XMLschemas/MLI/IR2/MLI.xsd
http://www.openmicroscopy.org/XMLschemas/MLI/IR2/MLI.xsd">
			<FunctionInputs>
			  <Input><PixelsArray FormalInput="Pixels Slice"/></Input>
			</FunctionInputs>
			<FunctionOutputs>
			  <Output><PixelsArray FormalOutput="Pixels Slice"/></Output>
			</FunctionOutputs>
		  </ExecutionInstructions>
		</AnalysisModule>	
	</AML:AnalysisModuleLibrary>
</OME>

NewTestChain.xml:
----------------------------------
<?xml version = "1.0" encoding = "UTF-8"?>

<AnalysisChains
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation=
   "http://www.openmicroscopy.org/XMLschemas/AnalysisModule/IR3/AnalysisChain.xsd">

  <AnalysisChain
     Name="New Test Chain" Locked="false">
	 <Description>
	  This is just a test
	 </Description>
		  
	<Nodes>
	  <Node NodeID = "Files" ProgramName = "Original files"/>
	  <Node NodeID = "Import" ProgramName = "Image import"/>
	  <Node NodeID = "TypeCast" ProgramName="Create pixels slices"/>
	  <Node NodeID = "NewTest" ProgramName="New Test"/>
    </Nodes>

    <Links>
      <Link FromNodeID="Files" FromOutputName="Files"
            ToNodeID="Import" ToInputName="Files"/>
	  <Link
         FromNodeID="Import" FromOutputName="Pixels"
         ToNodeID="TypeCast" ToInputName="Pixels"/>
	  <Link
         FromNodeID="TypeCast" FromOutputName="Slices"
         ToNodeID="NewTest" ToInputName="Pixels Slice"/>
    </Links>
  </AnalysisChain>
</AnalysisChains>

-Anh

On 8/19/05, T. J. Macura <tm289 at cam.ac.uk> wrote:
> Hi Anh,
> 
> I imported those two images into OME, wrote a matlab script exactly
> like yours and modified HistogramEqualization.ome to call matlabtest().
> I ran the chain and got the correct result (output and input Pixel Sets
> are the same).
> 
> Please send me your analysis module and chain xml files. I suspect you
> might be using convertToDatatype incorrectly (in such a way that 8 bit
> tiffs work e.g. uint8)
> 
> Tom
> 
> On Aug 18, 2005, at 3:10 PM, Anh Vu wrote:
> 
> > Hi! I noticed that on the 12 bits images I import into OME, when I ran
> > them against a matlab module that I wrote,
> 
> > the color on the resulting image is not what I expect.
> >
> > The matlab script is as simple as this
> >
> > function [output] = matlabtest(input)
> > output = input;
> >
> > I noticed that the images are converted to 16 bits in the input and
> > the output, but the results from the output is not the same as the
> > input. Is there anyway to fix this? I also tried 8 bits tiff and it
> > works fine.
> >
> > I attached a couple of tiff images that does what I described above.
> >
> > Thanks!
> > Anh
> > <43-5 x Ler A-2 Positive 1 - hypocotyl 1.tif><43-5 x Ler A-2 Positive
> > 1 - root 1.tif>
> 
>



More information about the ome-users mailing list