[Tomviz] Adding a file reader to Tomviz

Cory Quammen cory.quammen at kitware.com
Mon Jan 29 21:08:32 EST 2018


Hi Nathan,

It's great to hear you have been able to use Tomviz for your research.
Thanks for sharing the link to your paper!

It looks like you've done the hard work figuring out how to read the
ISQ file format and even providing a reference implementation. At the
moment we don't have infrastructure for loading a file from Python,
but writing a reader for this format in C++ would be fairly
straightforward. Tomviz currently includes a custom class
vtkOMETiffReader, which is a reasonable reference for how to set up a
reader for the ISQ format. It is somewhat complex in implementation,
but the important bits are

// Returns 1 if the reader can read the file with the given name, 0 if not.
int CanReadFile(const char* fname) VTK_OVERRIDE;

// Return a description of the file type.
const char* GetDescriptiveName() VTK_OVERRIDE;

// return a string with a space-separated list of file extensions
const char* GetFileExtensions() VTK_OVERRIDE;

 // Set the size, or extent, or the image.
void ExecuteInformation() VTK_OVERRIDE;

// Actually reads and populates the dataset.
void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation
*outInfo) VTK_OVERRIDE;


Modify

tomviz/pvextensions/CMakeLists.txt

to add the reader source file to the list of sources to compile, and
add the reader XML description to

tomviz/pvextensions/tomvizExtensions.xml

You'll also need to add your reader to the white list in

tomviz/Behaviors.cxx

and then add the reader instantiation in

tomviz/LoadDataReaction.cxx

It looks like a lot to do, but it really isn't too bad. Please let us
know if you have follow up questions.

Thanks,
Cory

On Mon, Jan 29, 2018 at 6:56 PM, Nathan Hughes <nathan1hughes at gmail.com> wrote:
> Hello,
>
> At the end of last year, our paper was published
> (https://plantmethods.biomedcentral.com/articles/10.1186/s13007-017-0229-8)
> and I used Tomviz for a lot of visual analysis.
>
> I'm currently in the process of moving a lot of my segmentation methods from
> MATLAB into Python and I would like to use Tomviz further. However we use a
> Scanco MicroCT scanner which produces a proprietary ISQ file format.  I have
> written a file reader for it, both in Python and MATLAB, I could also
> rewrite it in C/C++ if needed and would like to add it to Tomviz as it would
> be extremely useful for my Institute to use for a lot of our projects, I
> also know others in my field who would appreciate this addition too.
>
> Would someone be able to advise on how I could go about making this addition
> to the Tomviz software? Obviously, I can navigate the code, I just want to
> do this correctly and in a way in which I can feed this back to other users
> on Github.
>
> Mostly I am unsure of which specific files are needed to be altered in order
> to accept another file type and how to point to the function to handle it.
>
> As you can see here:
> https://gist.github.com/SirSharpest/fd0a039547eb4ca5f00b02de1216917f it's a
> straightforward process (this is just a quick example).
>
> Hope I can get some advise on this.
>
> Many thanks,
>
>
> _______________________________________________
> Tomviz mailing list
> Tomviz at public.kitware.com
> https://public.kitware.com/mailman/listinfo/tomviz
>



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.


More information about the Tomviz mailing list