Hi to all the Insight 3G users (for incompetent ones, Insight 3G [PDF] is a new software from TSI Inc that tries to compete for a long time with URAPIV :-)). The software is great, as we can see from the latest evaluation copy we work with, but it lacks one small thing - import of images from other sources rather than acquiried directly with Insight 3G. It means that one has to rename the files to let Insight understand that these are the pair of images to correlate. I do not know if it is the same with other software packages, but let’s be proud to tell that URAPIV works with all image formats (really thanks to Mathworks IMREAD) but also does not care about the naming convention: a/b or b/c or 1,2,3, … or whatever. It goes to the directory, looks into and decides which convention is used. Simple.
However, for those who’re “stacked” with Insight 3G and cannot move to URAPIV (:-)), can use one of the two scripts below to rename in more or less automatic way the images taken by a high speed camera, named 1,2,3,… and make them usable for Insight (put the renamed files into RawData subdirectory of your experiment)
In Python:
## Copyright (C) 2006 Alex Liberzon
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are
## met:
##
## 1. Redistributions of source code must retain the above copyright
## notice, this list of conditions and the following disclaimer.
## 2. Redistributions in binary form must reproduce the above copyright
## notice, this list of conditions and the following disclaimer in
## the documentation and/or other materials provided with the
## distribution.
##
## THIS SOFTWARE IS PROVIDED BY THE AUTHOR “AS IS” AND ANY EXPRESS OR
## IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
## WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
## DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
## INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
## (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
## SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
## IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
## POSSIBILITY OF SUCH DAMAGE.
#!/usr/bin/env python
“”" Python script that copies the successive TIFF files in the current directory in pairs of a
straddle form for the INSIGHT 3G software (by TSI Inc.): A,B with a user selected JUMP factor between the frames. New set of TIFF files is
generated in the same directory. “”"
import glob
import shutil
jump = input(”Please enter a jump: “)
d=glob.glob(’*.tif’)
for k in range(1,len(d)-jump):
src = d[k-1]
des = ‘RUN%06d.T000.D000.P000.H000.LA.TIF’ % k
shutil.copyfile(src,des)
src = d[k+jump-1]
des = ‘RUN%06d.T000.D000.P000.H000.LB.TIF’ % k
shutil.copyfile(src,des)
In Matlab:
function rename_TIFF_Insight3G(jump);
% Matlab function that copies the successive TIFF files in the current directory in pairs of a
%straddle form for the INSIGHT 3G software (by TSI Inc.): A,B with a user selected JUMP factor between the % frames.
% A new set of TIFF files is generated in the same directory.
if ~nargin, jump = 15, end
d = dir(’*.tif’);
k = 0;
for i = 1:length(d)-jump
k = k + 1;
dos(['copy ',d(i).name,' ',sprintf('Run%06d.T000.D000.P000.H001.LA.tif',k)]);
dos(['copy ',d(i+jump).name,' ',sprintf('Run%06d.T000.D000.P000.H001.LB.tif',k)]);
end
Of course it is very simple approach and should be really well developed, but TSI will probably develop a new version that will overcome this small difficulty. By that time, URAPIV will be anyhow much better.
Post a Comment