Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
ljsctc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Raymond Yung
ljsctc
Commits
caceb8ac
Commit
caceb8ac
authored
Feb 17, 2020
by
ac_21
Browse files
Options
Downloads
Patches
Plain Diff
ilastik import script
parent
076a4ea9
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ctc/reImportIlastik.m
+44
-0
44 additions, 0 deletions
ctc/reImportIlastik.m
ctc/writeH5.m
+12
-0
12 additions, 0 deletions
ctc/writeH5.m
with
56 additions
and
0 deletions
ctc/reImportIlastik.m
0 → 100644
+
44
−
0
View file @
caceb8ac
% function importFolder(infolder,outfolder,expname)
ilastikFolder
=
'/z/Raw/Shipper'
;
outfolder
=
'/z/leverjs/ctc2020/2d'
;
expname
=
'DIC-C2DH-HeLa_training_01_ix'
;
infolder
=
'/z/Raw/2d_DIC-C2DH-HeLa_training/DIC-C2DH-HeLa/01'
;
flist
=
dir
(
fullfile
(
infolder
,
'*.tif'
));
im
=
[];
imd1
=
[];
if
exist
(
fullfile
(
infolder
,
't000.tif'
),
'file'
)
tFormat
=
'%03d'
;
else
if
exist
(
fullfile
(
infolder
,
't0000.tif'
),
'file'
)
tFormat
=
'%04d'
;
else
fprintf
(
2
,
'importFolder : %s : could not read tif format! no t000 or t0000\n'
,
infolder
);
return
;
end
end
for
t
=
1
:
length
(
flist
)
fname
=
[
't'
num2str
(
t
-
1
,
tFormat
)
'.tif'
];
info
=
imfinfo
(
fullfile
(
infolder
,
fname
));
if
1
==
t
try
imd1
=
MicroscopeData
.
Original
.
ReadMetadata
(
infolder
,
fname
);
catch
imd1
.
PixelPhysicalSize
=
[
1
,
1
,
1
];
end
imd1
.
NumberOfChannels
=
2
;
end
im
(:,:,
1
,
1
,
t
)
=
imread
(
fullfile
(
infolder
,
fname
));
% now let's get the ilastik image
fnameIlastik
=
[
't'
num2str
(
t
,
tFormat
)
'_Probabilities Stage 2.tiff'
];
fnameIlastik
=
fullfile
(
ilastikFolder
,
fnameIlastik
);
if
exist
(
fnameIlastik
,
'file'
)
imIlastik
=
imread
(
fnameIlastik
);
im
(:,:,
1
,
2
,
t
)
=
imIlastik
(:,:,
2
);
end
end
im
=
mat2gray
(
im
);
imd1
.
DatasetName
=
expname
;
writeH5
(
im
,
imd1
,
expname
,
outfolder
);
This diff is collapsed.
Click to expand it.
ctc/writeH5.m
0 → 100644
+
12
−
0
View file @
caceb8ac
function
writeH5
(
im
,
imd1
,
expName
,
outfolder
)
% make sure leverjsUtilities project is on your path!
% e.g. path(path,'pathTo\git\utilities\src\MATLAB')
imd
=
MicroscopeData
.
MakeMetadataFromImage
(
im
);
imd
.
DatasetName
=
expName
;
imd
.
PixelPhysicalSize
=
imd1
.
PixelPhysicalSize
;
if
(
size
(
imd
.
Dimensions
,
2
)
~=
3
)
imd
.
Dimensions
=
[
imd
.
Dimensions
1
];
end
MicroscopeData
.
WriterH5
(
im
,
'imageData'
,
imd
,
'path'
,
outfolder
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment