Coding Period 3.2

 Hi!

Welcome back to my blog!

This week I worked on the following tasks:

1. Resolving the merge conflicts between branches xitosbml_cui and branch_cui in the XitoSBML repository. Once the conflicts were resolved, I was able to merge these branches into the master branch.


2. Writing Java code for taking a file directory as input and converting the desired number of segmented images to SBML models. For this, the code can be written as

@Command(name = "Running XitoSBML-CLI", mixinStandardHelpOptions = true, description = "Saves via File option", version = "1.0")


public class CLI_Filetype implements Callable<Integer> {


@Option(names = "-d", required = true, description = "Directory")

String inputDir;

@Option(names = "-n", required = true, description = "No.of images to be converted to SBML files")

int outputValue;

@Option(names = "-i", required = true, description = "Image file id")

String imageId;

@Option(names = "-o", required = true, description = "Output XML file id")

String outputId;


@Override

public Integer call() {

String[] input = new String[outputValue];

String[] output = new String[outputValue];

String dir = inputDir;


for (int i = 0; i < outputValue; i++) {

input[i] = dir + File.separator + imageId + (i + 1) + ".tif";

output[i] = dir + File.separator + outputId + (i + 1) + ".xml";

System.out.println(input[i]);

System.out.println(output[i]);

new CuiMainImgSpatial().runCui(input[i], output[i]);

}

return 0;

}


public static void main(String... args) {

System.exit(new CommandLine(new CLI_Filetype()).execute(args));

}


}


3. Writing a Python script for doing the same from the command line. In the last meeting, it was decided that we would try to obtain the SBML models corresponding to the images in a dataset iteratively fro the command line using the Python subprocess package. The following script was used to obtain run CuiRun.java for a single image:

import os

import subprocess

r = subprocess.call("java -jar C:\\Users\\Subroto\\XitoSBML\\cui.jar -i C:\\Users\\Subroto\\Desktop\\dataCLI\\gt1.tif -o C:\\Users\\Subroto\\Desktop\\dataCLI\\out1.xml")

For iterating over a dataset, the following script was used:

for i in range(5):

    inp = "gt"+str(i+1)

    outp = "out"+str(i+1)

    r = subprocess.call("java -jar C:\\Users\\Subroto\\XitoSBML\\cui.jar -i C:\\Users\\Subroto\\Desktop\\dataCLI\\inp.tif -o C:\\Users\\Subroto\\Desktop\\dataCLI\\outp.xml")

However, this returned a Null pointer exception.


Thanks to Mr. Yuta Tokuoka, this issue was resolved. Now we use the code

import os
import subprocess
for i in range(5):
inp = "gt"+str(i+1)
outp = "out"+str(i+1)
r = subprocess.call("java -jar C:\\Users\\Subroto\\XitoSBML\\cui.jar -i C:\\Users\\Subroto\\Desktop\\dataCLI\\{}.tif -o C:\\Users\\Subroto\\Desktop\\dataCLI\\{}.xml".format(inp, outp))


4. Resolving the issues in the XitoSBML repository and unetdl4j repository. These issues were closed:

https://github.com/Medha-B/XitoSBML/issues/2

https://github.com/Medha-B/XitoSBML/issues/3

https://github.com/Medha-B/XitoSBML/issues/4

https://github.com/Medha-B/XitoSBML/issues/5

https://github.com/Medha-B/XitoSBML/issues/6

https://github.com/Medha-B/unetdl4j/issues/4

https://github.com/Medha-B/unetdl4j/issues/16

5. Creating SBML models for the spatial SBML package repository and verifying with the Model Editor option in the XitoSBML plug-in. A dataset consisting of 100 segmented microscopic cellular images was used. The folder containing these images and the corresponding SBML documents can be obtained at https://drive.google.com/drive/folders/1KIUO4O8_o2KP8ZQkEqRb7RCKP613-XrC?usp=sharing (https://drive.google.com/drive/folders/1KIUO4O8_o2KP8ZQkEqRb7RCKP613-XrC). A typical segmented microscopic cellular image and its generated 3d ImageJ specimen:



Note: I also changed the keyword 'cui' to 'cli' in the XitoSBML repository, as instructed (https://github.com/Medha-B/XitoSBML/commit/28c12b96b32141022c13734395053065b1b94862).

Until the next time.....

La revedere!


Comments

Popular Posts