SAN JOSE -- San Jose Sharks coach Todd McLellan said he doesn't like to use the term "doghouse," but that's exactly where forward TJ Galiardi was residing for much of this season.

Galiardi was a healthy scratch 12 times in a stretch of 21 games from Jan. 31 to March 16. He'd come to the rink not knowing if he'd even be in the lineup on one of the bottom two lines.

"When you're in a slump and it's not really going well for you, it's hard to dig yourself out," McLellan said after the Sharks' morning skate Thursday at HP Pavilion. "Sometimes you just keep throwing sand on your own head. You get frustrated. You end up listening to people you probably shouldn't be listening to. Eventually you dig your way out, and now you've got to stay above ground level."

TJ Galiardi has come a long way this season with the Sharks. He now sees time on the team's top line with Joe Thornton and Brent Burns. (Photo: Bruce Kluckhohn/NHLI) TJ Galiardi has come a long way this season with the Sharks. He now sees time on the team's top line with Joe Thornton and Brent Burns.

Galiardi dug his way out and kept climbing, all the way to the Sharks' top line. He'll play his 17th straight game Thursday night when the Sharks face the Minnesota Wild. And for the third straight game, Galiardi will be the left wing on a line with center Joe Thornton and right wing Brent Burns.

Galiardi has three goals and two assists over his past eight games, including one goal Tuesday night in San Jose's 3-2 shootout win against the Los Angeles Kings.

Not bad for a player who thought he might get traded at the deadline.

"It was probably the hardest time of my career," Galiardi said of his struggles earlier this season. "You hear things. I think just before the deadline you hear you might be getting moved. I didn't want that. I finally got to know a lot of the guys here. You get relationships with them. And a little bit with the coaches too. I think it was just in the nick of time when I started playing well. It was right before the deadline. So I got myself off that radar."

The Sharks acquired Galiardi and Daniel Winnik from the Colorado Avalanche for Jamie McGinn in a trade on Feb. 27, 2012. The Sharks liked Galiardi's speed and energy, but he struggled with his new team, scoring one goal in 14 regular-season games and no goals in three Stanley Cup Playoff games.

This season, Galiardi got off to rough start. He had two points and no goals in his first 11 games and played his way out of a full-time spot in the lineup.

"He's always had that energy and that ability to skate and create, using his speed," McLellan said. "He's starting to use it a lot better now. I'll go back to confidence. What happens first? Does he use it and be effective and then the coaching staff gets confidence, or do the coaches give him a chance and then he uses it? I don't know which it was, but what we have found is a pretty happy marriage right now. He's using his assets to the best of his abilities, and when you get that from the majority of your players, you have a chance to win every night."

After a stretch of three straight healthy scratches, Galiardi returned to the lineup March 18 at the Anaheim Ducks and got an assist. He notched three more assists in his next five games and started moving up lines as he regained his self-confidence gained his coaches' confidence as well.

TJ Galiardi Left Wing - SJS GOALS: 4 | ASST: 8 | PTS: 12

SOG: 58 | +/-: 1

"When you don't have confidence, you're not going to play well," Galiardi said, looking back. "It was a tough time there. Even including last year, I don't think I ever got fully integrated into the lineup, and now I actually have a role and a responsibility. I think that's huge for players. When you know you're needed, it's a nice feeling. I think that's kind of what we have going here now. The fact that I'm playing on the top line, it's one of those things that goes along with having that responsibility. It's great.

"I think the coaches, I've finally gained their trust. They saw what I can do, and since then it's been great. I've just been pitching in a lot. I can't say enough about the linemates I've played with. It's made it a lot easier for me. Even including last year, I never really played with the skill guys since I've been here, and then they finally gave me a chance. I think I responded well to it, and it's been good since then."

On his goal against Los Angeles, Galiardi used his speed to get position near the crease, took a pass from Burns and scored.

"He's got a lot of speed," Burns said. "He's got a good shot. We've got some chemistry, so it's been fun."